diff --git a/Software/.gitignore b/Software/.gitignore new file mode 100644 index 0000000..49e0214 --- /dev/null +++ b/Software/.gitignore @@ -0,0 +1,19 @@ +SensorCharacterisation/SensorCharacterisation +IVScan/IVScan +CheckBaselineShift/CheckBaselineShift +TbNtupleMaker/TbNtupleMaker +ComputePedestals/ComputePedestals +ProcessRawData/ProcessRawData +ComputeCMN/ComputeCMN +LaserDelayScan/LaserDelayScan +PulseShapevsV/PulseShapevsV +BiasVoltageScan/BiasVoltageScan +AttenuationScan/AttenuationScan +CheckAlignment/CheckAlignment +Focusing/Focusing +CCE/CCE +CCEBiasVoltageScan/CCEBiasVoltageScan +CCEAttenuationScan/CCEAttenuationScan +CCEDelayScan/CCEDelayScan +Monitoring/PlotCooling +Monitoring/PlotTrends diff --git a/Software/Arduino/ResetAndControlStepperMotors216/ResetAndControlStepperMotors216.ino b/Software/Arduino/ResetAndControlStepperMotors216/ResetAndControlStepperMotors216.ino index 1171a09..ac95ab2 100644 --- a/Software/Arduino/ResetAndControlStepperMotors216/ResetAndControlStepperMotors216.ino +++ b/Software/Arduino/ResetAndControlStepperMotors216/ResetAndControlStepperMotors216.ino @@ -73,9 +73,9 @@ // Hans410 sensor. // Move the laser 3.60 cm (7200 steps) away from the x micro switch -// const int stepsFromXSwitch = 7200; +const int stepsFromXSwitch = 7200; // Move the laser 1.80 cm (3600 steps) away from the z micro switch -// const int stepsFromZSwitch = 3600; +const int stepsFromZSwitch = 3600; // Hans320 sensor. // Move the laser 5.40 cm (10800 steps) away from the x micro switch @@ -85,9 +85,9 @@ // ATLAS sensor. // Move the laser 5.30 cm (10600 steps) away from the x micro switch -const int stepsFromXSwitch = 10600; +// const int stepsFromXSwitch = 10600; // Move the laser 0.85 cm (1700 steps) away from the z micro switch -const int stepsFromZSwitch = 1700; +// const int stepsFromZSwitch = 1700; // Total number of steps we need along x. // const int totStepsX = 200; diff --git a/Software/AutomatedMeasurements/CCEDelayScanConfig/CCEDelayScanConfig56ns b/Software/AutomatedMeasurements/CCEDelayScanConfig/CCEDelayScanConfig56ns new file mode 100644 index 0000000..ece7fec --- /dev/null +++ b/Software/AutomatedMeasurements/CCEDelayScanConfig/CCEDelayScanConfig56ns @@ -0,0 +1,100 @@ +[Chip.0] +Icomp=5 +Ithdelta=5 +Ithmain=0 +Vrs=0 +mask=0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0 +trim=0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0 + +[Chip.1] +Icomp=5 +Ithdelta=5 +Ithmain=0 +Vrs=0 +mask=0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0 +trim=0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0 + +[DAQ] +delay=60 +enable_busy=false +monitor_channel=60 +nevts=10000000 +pulse_shape=false +sample_size=100 + +[analysis] +common_mode=true +neigh_cut=3.0000000000e+00 +noise=2.6843330855e+00;2.1273910742e+00;2.1946251615e+00;2.1792528015e+00;2.1346342653e+00;2.1304252071e+00;2.1487249342e+00;2.0736220208e+00;2.1174789609e+00;2.1198034078e+00;2.1245570630e+00;2.0585320753e+00;2.1158707879e+00;2.1035628675e+00;2.1147651929e+00;2.1183677238e+00;2.0299088119e+00;2.0714549926e+00;2.1464597704e+00;2.0827700463e+00;2.1103596971e+00;2.1527365459e+00;2.0422459056e+00;2.0550619460e+00;2.1458496486e+00;2.0129084057e+00;2.1129166776e+00;2.0748475125e+00;2.0199038746e+00;2.0192278668e+00;2.0089812223e+00;2.0455667312e+00;2.0199711846e+00;2.0644508452e+00;2.0334754732e+00;2.0264868749e+00;2.0679373437e+00;2.0575486813e+00;2.5246167453e+00;2.2849487840e+00;2.2444611935e+00;2.2618473659e+00;2.2822960523e+00;2.2300833669e+00;2.2270217638e+00;2.2602110154e+00;2.2587938434e+00;2.2785086163e+00;2.2340218049e+00;2.2102290887e+00;2.2414892074e+00;2.2287742588e+00;2.2539047171e+00;2.2935946178e+00;2.2757571087e+00;2.2933009647e+00;2.3066359472e+00;2.2178357716e+00;2.2774014449e+00;2.2331535822e+00;2.3097200912e+00;2.2968511656e+00;2.2460881810e+00;2.3032260897e+00;2.2426884896e+00;2.2743781671e+00;2.3089276152e+00;2.2302517447e+00;2.2502334945e+00;2.2082465105e+00;2.1827418263e+00;2.2702280811e+00;2.3041227089e+00;2.2281353014e+00;2.2805403204e+00;2.2439797345e+00;2.1939761911e+00;2.2656731875e+00;2.2440102332e+00;2.2189130484e+00;2.2024802646e+00;2.1796877507e+00;2.3316672524e+00;2.2375364421e+00;2.2224127116e+00;2.2778882187e+00;2.2235481125e+00;2.1747465694e+00;2.1475871833e+00;2.1865841942e+00;2.3106695732e+00;2.1564941968e+00;2.1540223079e+00;2.2060240104e+00;2.2314730122e+00;2.2285425174e+00;2.2001150809e+00;2.1897512930e+00;2.1812992133e+00;2.2280724603e+00;2.2238907887e+00;2.1746130603e+00;2.1259962129e+00;2.1996828807e+00;2.2179409498e+00;2.1751315309e+00;2.1931362069e+00;2.1966283799e+00;2.1504023509e+00;2.1641547419e+00;2.1633034580e+00;2.2235255539e+00;2.1572500811e+00;2.2297696204e+00;2.1241692106e+00;2.1678900738e+00;2.2585326443e+00;2.2400810497e+00;2.2470774439e+00;2.3776923690e+00;2.4333540473e+00;2.3767638731e+00;2.4335602253e+00;2.4452864976e+00;2.4316591635e+00;2.4519364652e+00;2.5289088517e+00;2.5027749471e+00;2.9552434446e+00;2.2236860157e+00;2.2107692233e+00;2.2181575627e+00;2.2706272121e+00;2.1724363563e+00;2.2082511487e+00;2.2194225733e+00;2.2116654230e+00;2.1716603662e+00;2.1296240316e+00;2.1814820640e+00;2.2293810426e+00;2.2580748863e+00;2.1773905536e+00;2.1950090035e+00;2.1441214013e+00;2.1595074854e+00;2.1547883840e+00;2.1592620182e+00;2.1594497556e+00;2.1438322583e+00;2.1363396508e+00;2.1259228242e+00;2.1611819848e+00;2.1343297099e+00;2.1310930150e+00;2.1237226551e+00;2.0987900547e+00;2.0924511182e+00;2.0764110643e+00;2.0937944006e+00;2.0430946342e+00;2.1128770459e+00;2.0988310668e+00;2.0548718573e+00;2.1473216777e+00;2.1174125587e+00;2.5155207226e+00;2.2877008154e+00;2.3115647814e+00;2.3205766796e+00;2.2709295076e+00;2.2755239851e+00;2.3178613063e+00;2.2193783768e+00;2.2817564969e+00;2.2801562370e+00;2.3071472915e+00;2.2754641757e+00;2.2703997068e+00;2.2864027712e+00;2.2653832718e+00;2.2498565696e+00;2.2251863116e+00;2.1888890282e+00;2.2163118923e+00;2.2540800655e+00;2.2653822747e+00;2.2693009185e+00;2.2328056230e+00;2.3000744107e+00;2.2882022194e+00;2.2382533665e+00;2.3034007218e+00;2.2525375362e+00;2.2954146378e+00;2.2789162849e+00;2.2703436682e+00;2.2028802700e+00;2.2447750248e+00;2.3545957631e+00;2.2384958536e+00;2.3325508006e+00;2.3008619347e+00;2.3863001092e+00;2.2581739478e+00;2.3202057804e+00;2.3090684725e+00;2.2364169520e+00;2.2796298306e+00;2.3110659269e+00;2.2590609320e+00;2.3232606615e+00;2.2584415812e+00;2.2866508672e+00;2.2766000223e+00;2.2454008714e+00;2.1597176205e+00;2.2897580909e+00;2.3211823405e+00;2.2091335163e+00;2.2843053408e+00;2.2571771565e+00;2.3324958013e+00;2.2472290769e+00;2.2707404522e+00;2.2168864547e+00;2.1716565078e+00;2.2590134748e+00;2.2129370724e+00;2.2362761677e+00;2.2444464049e+00;2.2196234633e+00;2.1831947719e+00;2.2193706787e+00;2.1470405712e+00;2.1872074374e+00;2.2606681576e+00;2.1642750257e+00;2.2703142783e+00;2.2055016368e+00;2.2711679878e+00;2.1718889738e+00;2.1936323217e+00;2.2307167866e+00;2.1774147970e+00;2.2761099197e+00;2.1855890494e+00;2.3393360903e+00;2.3540839037e+00;2.3766129592e+00;2.3776303459e+00;2.4572660110e+00;2.3829220321e+00;2.4281164347e+00;2.4824068116e+00;2.4967585749e+00 +noise_weight=1.0000000000e-03 +ped_weight=1.0000000000e-02 +pedestals=5.0355398374e+02;5.0355754425e+02;5.0032817033e+02;5.0243951998e+02;4.9941854706e+02;4.9795816268e+02;4.9754152820e+02;4.9811976064e+02;4.9713286303e+02;4.9590345816e+02;4.9750235459e+02;4.9738454231e+02;4.9782480720e+02;4.9701769957e+02;4.9666167427e+02;4.9990895783e+02;5.0031739717e+02;4.9377740950e+02;4.9280647150e+02;4.9502274166e+02;4.9353396384e+02;4.9385137850e+02;5.0074396684e+02;4.9811491269e+02;4.9532433658e+02;4.9796849379e+02;5.0040054929e+02;4.9705413739e+02;4.9759214358e+02;4.9973773740e+02;4.9844751567e+02;4.9935535196e+02;4.9679074588e+02;4.9734484679e+02;4.9771451765e+02;4.9884324598e+02;4.9970384313e+02;4.9995248652e+02;4.9315262874e+02;4.9119693467e+02;4.9577793669e+02;4.9443410255e+02;4.9735958705e+02;4.9784618161e+02;4.9864431094e+02;4.9704140014e+02;4.9111966250e+02;4.9590791757e+02;4.9730789733e+02;4.9780795897e+02;4.9722689298e+02;4.9582162333e+02;4.9292815382e+02;4.9373207719e+02;4.9180550736e+02;4.9541883553e+02;4.9892841700e+02;4.9837654641e+02;4.9829221219e+02;4.9927980720e+02;4.9678879744e+02;4.9041562221e+02;4.9665364288e+02;4.9938030627e+02;4.9626856256e+02;4.9640263368e+02;4.9569493023e+02;4.9630146856e+02;4.9703875619e+02;5.0157037418e+02;4.9793479990e+02;4.9641042349e+02;4.9846638815e+02;4.9942571904e+02;5.0054139671e+02;4.9682629718e+02;4.9772493219e+02;4.9899702034e+02;4.9830730123e+02;5.0096642761e+02;4.9930342579e+02;4.9784406361e+02;4.9969253013e+02;4.9513244566e+02;4.9914975978e+02;5.0142337484e+02;5.0210404874e+02;5.0255501997e+02;4.9699012847e+02;4.9678091832e+02;5.0196622809e+02;5.0017225410e+02;4.9662210857e+02;5.0196547744e+02;4.9897621259e+02;4.9620775794e+02;4.9209692531e+02;4.9905885274e+02;4.9248138240e+02;5.0036891268e+02;5.0059799615e+02;4.9825167346e+02;4.9459704239e+02;4.9562590750e+02;4.9816595672e+02;4.9881222872e+02;4.9759810758e+02;5.0223559772e+02;5.0271469623e+02;5.0178510965e+02;4.9384854702e+02;5.0078740962e+02;4.9695185802e+02;5.0043807101e+02;4.9957882252e+02;5.0144438688e+02;5.0119258813e+02;5.0816683898e+02;5.0645829290e+02;5.0767212022e+02;5.1207726898e+02;5.0802103923e+02;5.0957878015e+02;5.1570196490e+02;5.0892889781e+02;5.0670900600e+02;5.0584312216e+02;5.1292362390e+02;5.0813562062e+02;5.0864338860e+02;5.0784200448e+02;5.0501667382e+02;5.0696882864e+02;5.0989227617e+02;5.0468170725e+02;5.0601937979e+02;5.0603936521e+02;5.0652279702e+02;5.0221793527e+02;5.0245970428e+02;5.0343441573e+02;5.0323159384e+02;5.0346802496e+02;5.0555290015e+02;5.1083601202e+02;5.0507814125e+02;5.0917491703e+02;5.0660007785e+02;5.0683373056e+02;5.0826038561e+02;5.0744563605e+02;5.0500389862e+02;5.0969013531e+02;5.0575155765e+02;5.0948947872e+02;5.0530541186e+02;5.0110755466e+02;5.0331062117e+02;5.0650396812e+02;5.0583777387e+02;5.0133886575e+02;5.0560239667e+02;5.0317212624e+02;5.0227882152e+02;5.0216882791e+02;5.0424604553e+02;4.9794110852e+02;4.9763392151e+02;5.0207175155e+02;4.9913319495e+02;4.9771413224e+02;4.9602556354e+02;5.0038559402e+02;4.9713693327e+02;4.9800179035e+02;4.9711527574e+02;4.9971216390e+02;5.0104739252e+02;4.9762885508e+02;4.9718186032e+02;4.9983704711e+02;5.0018342187e+02;5.0928970398e+02;5.0171279938e+02;5.0271038955e+02;5.0359302306e+02;5.0405965696e+02;5.0019749570e+02;5.0483950858e+02;4.9701573545e+02;5.0013304461e+02;4.9859836190e+02;4.9764042775e+02;4.9900322044e+02;5.0411488991e+02;4.9946178422e+02;4.9872279760e+02;4.9965764091e+02;4.9735511712e+02;5.0061017040e+02;5.0116636864e+02;4.9938112359e+02;5.0279613342e+02;5.0487305378e+02;5.0150200987e+02;5.0149684770e+02;4.9865078104e+02;5.0421775840e+02;5.0269934129e+02;5.0484950273e+02;5.0005248836e+02;5.0860992477e+02;5.0651133496e+02;5.0686708944e+02;5.0429990137e+02;5.0547443044e+02;5.0681838345e+02;5.0519810985e+02;5.0587816685e+02;5.0992707894e+02;5.0675194906e+02;5.0429400867e+02;5.0909874525e+02;5.0763026604e+02;5.0967356660e+02;5.0341278452e+02;5.0896439271e+02;5.1261241496e+02;5.1151173879e+02;5.0846499307e+02;5.0903967925e+02;5.1222135362e+02;5.0827723365e+02;5.1308947859e+02;5.1392767027e+02;5.0659116667e+02;5.0606883260e+02;5.1842643234e+02;5.1017636629e+02;5.0994222680e+02;5.1403987637e+02;5.1409206919e+02;5.0866524903e+02;5.1187960598e+02;5.0592813273e+02;5.0739655389e+02;5.1499977651e+02;5.2038084186e+02;5.2014458934e+02;5.2060263499e+02;5.2014585504e+02;5.2119233017e+02;5.1688988636e+02;5.1818552311e+02;5.1604165069e+02;5.2100912740e+02 +polarity=0.0000000000e+00 +seed_cut=5.0000000000e+00 +sn_cut=5.0000000000e+00 + +[beetle] +CompCtrl=9 +Ibuf=10 +Icurrbuf=102 +Ipipe=13 +Ipre=76 +Isf=26 +Isha=10 +Itp=0 +Ivoltbuf=20 +Latency=128 +ROCtrl=26 +RclkDiv=0 +Vd=130 +Vdcl=105 +Vfp=0 +Vfs=0 +mask=3 + +[calibration] +charge=30720 +delay=85 +scan_charge=true + +[charge_scan] +from=0 +nevts=100 +npts=32 +to=32768 + +[comparator] +enable=false +mode=0 +polarity=0 + +[delay_scan] +from=0 +nevts=100 +npts=32 +to=256 + +[laser] +delay=56 + +[laser_sync] +from=30 +nevts=100 +npts=100 +to=130 + +[plugin] +active_on_load=false +hook= +lang= +lib= +path= + +[trigger] +dacA=-200 +dacB=-200 +dacC=-1000 +dacD=1000 +trigger_and=false +trigger_pulse=false + diff --git a/Software/AutomatedMeasurements/CCEDelayScanConfig/CCEDelayScanConfig57ns b/Software/AutomatedMeasurements/CCEDelayScanConfig/CCEDelayScanConfig57ns new file mode 100644 index 0000000..4adb35b --- /dev/null +++ b/Software/AutomatedMeasurements/CCEDelayScanConfig/CCEDelayScanConfig57ns @@ -0,0 +1,100 @@ +[Chip.0] +Icomp=5 +Ithdelta=5 +Ithmain=0 +Vrs=0 +mask=0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0 +trim=0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0 + +[Chip.1] +Icomp=5 +Ithdelta=5 +Ithmain=0 +Vrs=0 +mask=0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0 +trim=0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0 + +[DAQ] +delay=60 +enable_busy=false +monitor_channel=60 +nevts=10000000 +pulse_shape=false +sample_size=100 + +[analysis] +common_mode=true +neigh_cut=3.0000000000e+00 +noise=2.6843330855e+00;2.1273910742e+00;2.1946251615e+00;2.1792528015e+00;2.1346342653e+00;2.1304252071e+00;2.1487249342e+00;2.0736220208e+00;2.1174789609e+00;2.1198034078e+00;2.1245570630e+00;2.0585320753e+00;2.1158707879e+00;2.1035628675e+00;2.1147651929e+00;2.1183677238e+00;2.0299088119e+00;2.0714549926e+00;2.1464597704e+00;2.0827700463e+00;2.1103596971e+00;2.1527365459e+00;2.0422459056e+00;2.0550619460e+00;2.1458496486e+00;2.0129084057e+00;2.1129166776e+00;2.0748475125e+00;2.0199038746e+00;2.0192278668e+00;2.0089812223e+00;2.0455667312e+00;2.0199711846e+00;2.0644508452e+00;2.0334754732e+00;2.0264868749e+00;2.0679373437e+00;2.0575486813e+00;2.5246167453e+00;2.2849487840e+00;2.2444611935e+00;2.2618473659e+00;2.2822960523e+00;2.2300833669e+00;2.2270217638e+00;2.2602110154e+00;2.2587938434e+00;2.2785086163e+00;2.2340218049e+00;2.2102290887e+00;2.2414892074e+00;2.2287742588e+00;2.2539047171e+00;2.2935946178e+00;2.2757571087e+00;2.2933009647e+00;2.3066359472e+00;2.2178357716e+00;2.2774014449e+00;2.2331535822e+00;2.3097200912e+00;2.2968511656e+00;2.2460881810e+00;2.3032260897e+00;2.2426884896e+00;2.2743781671e+00;2.3089276152e+00;2.2302517447e+00;2.2502334945e+00;2.2082465105e+00;2.1827418263e+00;2.2702280811e+00;2.3041227089e+00;2.2281353014e+00;2.2805403204e+00;2.2439797345e+00;2.1939761911e+00;2.2656731875e+00;2.2440102332e+00;2.2189130484e+00;2.2024802646e+00;2.1796877507e+00;2.3316672524e+00;2.2375364421e+00;2.2224127116e+00;2.2778882187e+00;2.2235481125e+00;2.1747465694e+00;2.1475871833e+00;2.1865841942e+00;2.3106695732e+00;2.1564941968e+00;2.1540223079e+00;2.2060240104e+00;2.2314730122e+00;2.2285425174e+00;2.2001150809e+00;2.1897512930e+00;2.1812992133e+00;2.2280724603e+00;2.2238907887e+00;2.1746130603e+00;2.1259962129e+00;2.1996828807e+00;2.2179409498e+00;2.1751315309e+00;2.1931362069e+00;2.1966283799e+00;2.1504023509e+00;2.1641547419e+00;2.1633034580e+00;2.2235255539e+00;2.1572500811e+00;2.2297696204e+00;2.1241692106e+00;2.1678900738e+00;2.2585326443e+00;2.2400810497e+00;2.2470774439e+00;2.3776923690e+00;2.4333540473e+00;2.3767638731e+00;2.4335602253e+00;2.4452864976e+00;2.4316591635e+00;2.4519364652e+00;2.5289088517e+00;2.5027749471e+00;2.9552434446e+00;2.2236860157e+00;2.2107692233e+00;2.2181575627e+00;2.2706272121e+00;2.1724363563e+00;2.2082511487e+00;2.2194225733e+00;2.2116654230e+00;2.1716603662e+00;2.1296240316e+00;2.1814820640e+00;2.2293810426e+00;2.2580748863e+00;2.1773905536e+00;2.1950090035e+00;2.1441214013e+00;2.1595074854e+00;2.1547883840e+00;2.1592620182e+00;2.1594497556e+00;2.1438322583e+00;2.1363396508e+00;2.1259228242e+00;2.1611819848e+00;2.1343297099e+00;2.1310930150e+00;2.1237226551e+00;2.0987900547e+00;2.0924511182e+00;2.0764110643e+00;2.0937944006e+00;2.0430946342e+00;2.1128770459e+00;2.0988310668e+00;2.0548718573e+00;2.1473216777e+00;2.1174125587e+00;2.5155207226e+00;2.2877008154e+00;2.3115647814e+00;2.3205766796e+00;2.2709295076e+00;2.2755239851e+00;2.3178613063e+00;2.2193783768e+00;2.2817564969e+00;2.2801562370e+00;2.3071472915e+00;2.2754641757e+00;2.2703997068e+00;2.2864027712e+00;2.2653832718e+00;2.2498565696e+00;2.2251863116e+00;2.1888890282e+00;2.2163118923e+00;2.2540800655e+00;2.2653822747e+00;2.2693009185e+00;2.2328056230e+00;2.3000744107e+00;2.2882022194e+00;2.2382533665e+00;2.3034007218e+00;2.2525375362e+00;2.2954146378e+00;2.2789162849e+00;2.2703436682e+00;2.2028802700e+00;2.2447750248e+00;2.3545957631e+00;2.2384958536e+00;2.3325508006e+00;2.3008619347e+00;2.3863001092e+00;2.2581739478e+00;2.3202057804e+00;2.3090684725e+00;2.2364169520e+00;2.2796298306e+00;2.3110659269e+00;2.2590609320e+00;2.3232606615e+00;2.2584415812e+00;2.2866508672e+00;2.2766000223e+00;2.2454008714e+00;2.1597176205e+00;2.2897580909e+00;2.3211823405e+00;2.2091335163e+00;2.2843053408e+00;2.2571771565e+00;2.3324958013e+00;2.2472290769e+00;2.2707404522e+00;2.2168864547e+00;2.1716565078e+00;2.2590134748e+00;2.2129370724e+00;2.2362761677e+00;2.2444464049e+00;2.2196234633e+00;2.1831947719e+00;2.2193706787e+00;2.1470405712e+00;2.1872074374e+00;2.2606681576e+00;2.1642750257e+00;2.2703142783e+00;2.2055016368e+00;2.2711679878e+00;2.1718889738e+00;2.1936323217e+00;2.2307167866e+00;2.1774147970e+00;2.2761099197e+00;2.1855890494e+00;2.3393360903e+00;2.3540839037e+00;2.3766129592e+00;2.3776303459e+00;2.4572660110e+00;2.3829220321e+00;2.4281164347e+00;2.4824068116e+00;2.4967585749e+00 +noise_weight=1.0000000000e-03 +ped_weight=1.0000000000e-02 +pedestals=5.0355398374e+02;5.0355754425e+02;5.0032817033e+02;5.0243951998e+02;4.9941854706e+02;4.9795816268e+02;4.9754152820e+02;4.9811976064e+02;4.9713286303e+02;4.9590345816e+02;4.9750235459e+02;4.9738454231e+02;4.9782480720e+02;4.9701769957e+02;4.9666167427e+02;4.9990895783e+02;5.0031739717e+02;4.9377740950e+02;4.9280647150e+02;4.9502274166e+02;4.9353396384e+02;4.9385137850e+02;5.0074396684e+02;4.9811491269e+02;4.9532433658e+02;4.9796849379e+02;5.0040054929e+02;4.9705413739e+02;4.9759214358e+02;4.9973773740e+02;4.9844751567e+02;4.9935535196e+02;4.9679074588e+02;4.9734484679e+02;4.9771451765e+02;4.9884324598e+02;4.9970384313e+02;4.9995248652e+02;4.9315262874e+02;4.9119693467e+02;4.9577793669e+02;4.9443410255e+02;4.9735958705e+02;4.9784618161e+02;4.9864431094e+02;4.9704140014e+02;4.9111966250e+02;4.9590791757e+02;4.9730789733e+02;4.9780795897e+02;4.9722689298e+02;4.9582162333e+02;4.9292815382e+02;4.9373207719e+02;4.9180550736e+02;4.9541883553e+02;4.9892841700e+02;4.9837654641e+02;4.9829221219e+02;4.9927980720e+02;4.9678879744e+02;4.9041562221e+02;4.9665364288e+02;4.9938030627e+02;4.9626856256e+02;4.9640263368e+02;4.9569493023e+02;4.9630146856e+02;4.9703875619e+02;5.0157037418e+02;4.9793479990e+02;4.9641042349e+02;4.9846638815e+02;4.9942571904e+02;5.0054139671e+02;4.9682629718e+02;4.9772493219e+02;4.9899702034e+02;4.9830730123e+02;5.0096642761e+02;4.9930342579e+02;4.9784406361e+02;4.9969253013e+02;4.9513244566e+02;4.9914975978e+02;5.0142337484e+02;5.0210404874e+02;5.0255501997e+02;4.9699012847e+02;4.9678091832e+02;5.0196622809e+02;5.0017225410e+02;4.9662210857e+02;5.0196547744e+02;4.9897621259e+02;4.9620775794e+02;4.9209692531e+02;4.9905885274e+02;4.9248138240e+02;5.0036891268e+02;5.0059799615e+02;4.9825167346e+02;4.9459704239e+02;4.9562590750e+02;4.9816595672e+02;4.9881222872e+02;4.9759810758e+02;5.0223559772e+02;5.0271469623e+02;5.0178510965e+02;4.9384854702e+02;5.0078740962e+02;4.9695185802e+02;5.0043807101e+02;4.9957882252e+02;5.0144438688e+02;5.0119258813e+02;5.0816683898e+02;5.0645829290e+02;5.0767212022e+02;5.1207726898e+02;5.0802103923e+02;5.0957878015e+02;5.1570196490e+02;5.0892889781e+02;5.0670900600e+02;5.0584312216e+02;5.1292362390e+02;5.0813562062e+02;5.0864338860e+02;5.0784200448e+02;5.0501667382e+02;5.0696882864e+02;5.0989227617e+02;5.0468170725e+02;5.0601937979e+02;5.0603936521e+02;5.0652279702e+02;5.0221793527e+02;5.0245970428e+02;5.0343441573e+02;5.0323159384e+02;5.0346802496e+02;5.0555290015e+02;5.1083601202e+02;5.0507814125e+02;5.0917491703e+02;5.0660007785e+02;5.0683373056e+02;5.0826038561e+02;5.0744563605e+02;5.0500389862e+02;5.0969013531e+02;5.0575155765e+02;5.0948947872e+02;5.0530541186e+02;5.0110755466e+02;5.0331062117e+02;5.0650396812e+02;5.0583777387e+02;5.0133886575e+02;5.0560239667e+02;5.0317212624e+02;5.0227882152e+02;5.0216882791e+02;5.0424604553e+02;4.9794110852e+02;4.9763392151e+02;5.0207175155e+02;4.9913319495e+02;4.9771413224e+02;4.9602556354e+02;5.0038559402e+02;4.9713693327e+02;4.9800179035e+02;4.9711527574e+02;4.9971216390e+02;5.0104739252e+02;4.9762885508e+02;4.9718186032e+02;4.9983704711e+02;5.0018342187e+02;5.0928970398e+02;5.0171279938e+02;5.0271038955e+02;5.0359302306e+02;5.0405965696e+02;5.0019749570e+02;5.0483950858e+02;4.9701573545e+02;5.0013304461e+02;4.9859836190e+02;4.9764042775e+02;4.9900322044e+02;5.0411488991e+02;4.9946178422e+02;4.9872279760e+02;4.9965764091e+02;4.9735511712e+02;5.0061017040e+02;5.0116636864e+02;4.9938112359e+02;5.0279613342e+02;5.0487305378e+02;5.0150200987e+02;5.0149684770e+02;4.9865078104e+02;5.0421775840e+02;5.0269934129e+02;5.0484950273e+02;5.0005248836e+02;5.0860992477e+02;5.0651133496e+02;5.0686708944e+02;5.0429990137e+02;5.0547443044e+02;5.0681838345e+02;5.0519810985e+02;5.0587816685e+02;5.0992707894e+02;5.0675194906e+02;5.0429400867e+02;5.0909874525e+02;5.0763026604e+02;5.0967356660e+02;5.0341278452e+02;5.0896439271e+02;5.1261241496e+02;5.1151173879e+02;5.0846499307e+02;5.0903967925e+02;5.1222135362e+02;5.0827723365e+02;5.1308947859e+02;5.1392767027e+02;5.0659116667e+02;5.0606883260e+02;5.1842643234e+02;5.1017636629e+02;5.0994222680e+02;5.1403987637e+02;5.1409206919e+02;5.0866524903e+02;5.1187960598e+02;5.0592813273e+02;5.0739655389e+02;5.1499977651e+02;5.2038084186e+02;5.2014458934e+02;5.2060263499e+02;5.2014585504e+02;5.2119233017e+02;5.1688988636e+02;5.1818552311e+02;5.1604165069e+02;5.2100912740e+02 +polarity=0.0000000000e+00 +seed_cut=5.0000000000e+00 +sn_cut=5.0000000000e+00 + +[beetle] +CompCtrl=9 +Ibuf=10 +Icurrbuf=102 +Ipipe=13 +Ipre=76 +Isf=26 +Isha=10 +Itp=0 +Ivoltbuf=20 +Latency=128 +ROCtrl=26 +RclkDiv=0 +Vd=130 +Vdcl=105 +Vfp=0 +Vfs=0 +mask=3 + +[calibration] +charge=30720 +delay=85 +scan_charge=true + +[charge_scan] +from=0 +nevts=100 +npts=32 +to=32768 + +[comparator] +enable=false +mode=0 +polarity=0 + +[delay_scan] +from=0 +nevts=100 +npts=32 +to=256 + +[laser] +delay=57 + +[laser_sync] +from=30 +nevts=100 +npts=100 +to=130 + +[plugin] +active_on_load=false +hook= +lang= +lib= +path= + +[trigger] +dacA=-200 +dacB=-200 +dacC=-1000 +dacD=1000 +trigger_and=false +trigger_pulse=false + diff --git a/Software/AutomatedMeasurements/CCEDelayScanConfig/CCEDelayScanConfig58ns b/Software/AutomatedMeasurements/CCEDelayScanConfig/CCEDelayScanConfig58ns new file mode 100644 index 0000000..7846361 --- /dev/null +++ b/Software/AutomatedMeasurements/CCEDelayScanConfig/CCEDelayScanConfig58ns @@ -0,0 +1,100 @@ +[Chip.0] +Icomp=5 +Ithdelta=5 +Ithmain=0 +Vrs=0 +mask=0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0 +trim=0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0 + +[Chip.1] +Icomp=5 +Ithdelta=5 +Ithmain=0 +Vrs=0 +mask=0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0 +trim=0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0 + +[DAQ] +delay=60 +enable_busy=false +monitor_channel=60 +nevts=10000000 +pulse_shape=false +sample_size=100 + +[analysis] +common_mode=true +neigh_cut=3.0000000000e+00 +noise=2.6843330855e+00;2.1273910742e+00;2.1946251615e+00;2.1792528015e+00;2.1346342653e+00;2.1304252071e+00;2.1487249342e+00;2.0736220208e+00;2.1174789609e+00;2.1198034078e+00;2.1245570630e+00;2.0585320753e+00;2.1158707879e+00;2.1035628675e+00;2.1147651929e+00;2.1183677238e+00;2.0299088119e+00;2.0714549926e+00;2.1464597704e+00;2.0827700463e+00;2.1103596971e+00;2.1527365459e+00;2.0422459056e+00;2.0550619460e+00;2.1458496486e+00;2.0129084057e+00;2.1129166776e+00;2.0748475125e+00;2.0199038746e+00;2.0192278668e+00;2.0089812223e+00;2.0455667312e+00;2.0199711846e+00;2.0644508452e+00;2.0334754732e+00;2.0264868749e+00;2.0679373437e+00;2.0575486813e+00;2.5246167453e+00;2.2849487840e+00;2.2444611935e+00;2.2618473659e+00;2.2822960523e+00;2.2300833669e+00;2.2270217638e+00;2.2602110154e+00;2.2587938434e+00;2.2785086163e+00;2.2340218049e+00;2.2102290887e+00;2.2414892074e+00;2.2287742588e+00;2.2539047171e+00;2.2935946178e+00;2.2757571087e+00;2.2933009647e+00;2.3066359472e+00;2.2178357716e+00;2.2774014449e+00;2.2331535822e+00;2.3097200912e+00;2.2968511656e+00;2.2460881810e+00;2.3032260897e+00;2.2426884896e+00;2.2743781671e+00;2.3089276152e+00;2.2302517447e+00;2.2502334945e+00;2.2082465105e+00;2.1827418263e+00;2.2702280811e+00;2.3041227089e+00;2.2281353014e+00;2.2805403204e+00;2.2439797345e+00;2.1939761911e+00;2.2656731875e+00;2.2440102332e+00;2.2189130484e+00;2.2024802646e+00;2.1796877507e+00;2.3316672524e+00;2.2375364421e+00;2.2224127116e+00;2.2778882187e+00;2.2235481125e+00;2.1747465694e+00;2.1475871833e+00;2.1865841942e+00;2.3106695732e+00;2.1564941968e+00;2.1540223079e+00;2.2060240104e+00;2.2314730122e+00;2.2285425174e+00;2.2001150809e+00;2.1897512930e+00;2.1812992133e+00;2.2280724603e+00;2.2238907887e+00;2.1746130603e+00;2.1259962129e+00;2.1996828807e+00;2.2179409498e+00;2.1751315309e+00;2.1931362069e+00;2.1966283799e+00;2.1504023509e+00;2.1641547419e+00;2.1633034580e+00;2.2235255539e+00;2.1572500811e+00;2.2297696204e+00;2.1241692106e+00;2.1678900738e+00;2.2585326443e+00;2.2400810497e+00;2.2470774439e+00;2.3776923690e+00;2.4333540473e+00;2.3767638731e+00;2.4335602253e+00;2.4452864976e+00;2.4316591635e+00;2.4519364652e+00;2.5289088517e+00;2.5027749471e+00;2.9552434446e+00;2.2236860157e+00;2.2107692233e+00;2.2181575627e+00;2.2706272121e+00;2.1724363563e+00;2.2082511487e+00;2.2194225733e+00;2.2116654230e+00;2.1716603662e+00;2.1296240316e+00;2.1814820640e+00;2.2293810426e+00;2.2580748863e+00;2.1773905536e+00;2.1950090035e+00;2.1441214013e+00;2.1595074854e+00;2.1547883840e+00;2.1592620182e+00;2.1594497556e+00;2.1438322583e+00;2.1363396508e+00;2.1259228242e+00;2.1611819848e+00;2.1343297099e+00;2.1310930150e+00;2.1237226551e+00;2.0987900547e+00;2.0924511182e+00;2.0764110643e+00;2.0937944006e+00;2.0430946342e+00;2.1128770459e+00;2.0988310668e+00;2.0548718573e+00;2.1473216777e+00;2.1174125587e+00;2.5155207226e+00;2.2877008154e+00;2.3115647814e+00;2.3205766796e+00;2.2709295076e+00;2.2755239851e+00;2.3178613063e+00;2.2193783768e+00;2.2817564969e+00;2.2801562370e+00;2.3071472915e+00;2.2754641757e+00;2.2703997068e+00;2.2864027712e+00;2.2653832718e+00;2.2498565696e+00;2.2251863116e+00;2.1888890282e+00;2.2163118923e+00;2.2540800655e+00;2.2653822747e+00;2.2693009185e+00;2.2328056230e+00;2.3000744107e+00;2.2882022194e+00;2.2382533665e+00;2.3034007218e+00;2.2525375362e+00;2.2954146378e+00;2.2789162849e+00;2.2703436682e+00;2.2028802700e+00;2.2447750248e+00;2.3545957631e+00;2.2384958536e+00;2.3325508006e+00;2.3008619347e+00;2.3863001092e+00;2.2581739478e+00;2.3202057804e+00;2.3090684725e+00;2.2364169520e+00;2.2796298306e+00;2.3110659269e+00;2.2590609320e+00;2.3232606615e+00;2.2584415812e+00;2.2866508672e+00;2.2766000223e+00;2.2454008714e+00;2.1597176205e+00;2.2897580909e+00;2.3211823405e+00;2.2091335163e+00;2.2843053408e+00;2.2571771565e+00;2.3324958013e+00;2.2472290769e+00;2.2707404522e+00;2.2168864547e+00;2.1716565078e+00;2.2590134748e+00;2.2129370724e+00;2.2362761677e+00;2.2444464049e+00;2.2196234633e+00;2.1831947719e+00;2.2193706787e+00;2.1470405712e+00;2.1872074374e+00;2.2606681576e+00;2.1642750257e+00;2.2703142783e+00;2.2055016368e+00;2.2711679878e+00;2.1718889738e+00;2.1936323217e+00;2.2307167866e+00;2.1774147970e+00;2.2761099197e+00;2.1855890494e+00;2.3393360903e+00;2.3540839037e+00;2.3766129592e+00;2.3776303459e+00;2.4572660110e+00;2.3829220321e+00;2.4281164347e+00;2.4824068116e+00;2.4967585749e+00 +noise_weight=1.0000000000e-03 +ped_weight=1.0000000000e-02 +pedestals=5.0355398374e+02;5.0355754425e+02;5.0032817033e+02;5.0243951998e+02;4.9941854706e+02;4.9795816268e+02;4.9754152820e+02;4.9811976064e+02;4.9713286303e+02;4.9590345816e+02;4.9750235459e+02;4.9738454231e+02;4.9782480720e+02;4.9701769957e+02;4.9666167427e+02;4.9990895783e+02;5.0031739717e+02;4.9377740950e+02;4.9280647150e+02;4.9502274166e+02;4.9353396384e+02;4.9385137850e+02;5.0074396684e+02;4.9811491269e+02;4.9532433658e+02;4.9796849379e+02;5.0040054929e+02;4.9705413739e+02;4.9759214358e+02;4.9973773740e+02;4.9844751567e+02;4.9935535196e+02;4.9679074588e+02;4.9734484679e+02;4.9771451765e+02;4.9884324598e+02;4.9970384313e+02;4.9995248652e+02;4.9315262874e+02;4.9119693467e+02;4.9577793669e+02;4.9443410255e+02;4.9735958705e+02;4.9784618161e+02;4.9864431094e+02;4.9704140014e+02;4.9111966250e+02;4.9590791757e+02;4.9730789733e+02;4.9780795897e+02;4.9722689298e+02;4.9582162333e+02;4.9292815382e+02;4.9373207719e+02;4.9180550736e+02;4.9541883553e+02;4.9892841700e+02;4.9837654641e+02;4.9829221219e+02;4.9927980720e+02;4.9678879744e+02;4.9041562221e+02;4.9665364288e+02;4.9938030627e+02;4.9626856256e+02;4.9640263368e+02;4.9569493023e+02;4.9630146856e+02;4.9703875619e+02;5.0157037418e+02;4.9793479990e+02;4.9641042349e+02;4.9846638815e+02;4.9942571904e+02;5.0054139671e+02;4.9682629718e+02;4.9772493219e+02;4.9899702034e+02;4.9830730123e+02;5.0096642761e+02;4.9930342579e+02;4.9784406361e+02;4.9969253013e+02;4.9513244566e+02;4.9914975978e+02;5.0142337484e+02;5.0210404874e+02;5.0255501997e+02;4.9699012847e+02;4.9678091832e+02;5.0196622809e+02;5.0017225410e+02;4.9662210857e+02;5.0196547744e+02;4.9897621259e+02;4.9620775794e+02;4.9209692531e+02;4.9905885274e+02;4.9248138240e+02;5.0036891268e+02;5.0059799615e+02;4.9825167346e+02;4.9459704239e+02;4.9562590750e+02;4.9816595672e+02;4.9881222872e+02;4.9759810758e+02;5.0223559772e+02;5.0271469623e+02;5.0178510965e+02;4.9384854702e+02;5.0078740962e+02;4.9695185802e+02;5.0043807101e+02;4.9957882252e+02;5.0144438688e+02;5.0119258813e+02;5.0816683898e+02;5.0645829290e+02;5.0767212022e+02;5.1207726898e+02;5.0802103923e+02;5.0957878015e+02;5.1570196490e+02;5.0892889781e+02;5.0670900600e+02;5.0584312216e+02;5.1292362390e+02;5.0813562062e+02;5.0864338860e+02;5.0784200448e+02;5.0501667382e+02;5.0696882864e+02;5.0989227617e+02;5.0468170725e+02;5.0601937979e+02;5.0603936521e+02;5.0652279702e+02;5.0221793527e+02;5.0245970428e+02;5.0343441573e+02;5.0323159384e+02;5.0346802496e+02;5.0555290015e+02;5.1083601202e+02;5.0507814125e+02;5.0917491703e+02;5.0660007785e+02;5.0683373056e+02;5.0826038561e+02;5.0744563605e+02;5.0500389862e+02;5.0969013531e+02;5.0575155765e+02;5.0948947872e+02;5.0530541186e+02;5.0110755466e+02;5.0331062117e+02;5.0650396812e+02;5.0583777387e+02;5.0133886575e+02;5.0560239667e+02;5.0317212624e+02;5.0227882152e+02;5.0216882791e+02;5.0424604553e+02;4.9794110852e+02;4.9763392151e+02;5.0207175155e+02;4.9913319495e+02;4.9771413224e+02;4.9602556354e+02;5.0038559402e+02;4.9713693327e+02;4.9800179035e+02;4.9711527574e+02;4.9971216390e+02;5.0104739252e+02;4.9762885508e+02;4.9718186032e+02;4.9983704711e+02;5.0018342187e+02;5.0928970398e+02;5.0171279938e+02;5.0271038955e+02;5.0359302306e+02;5.0405965696e+02;5.0019749570e+02;5.0483950858e+02;4.9701573545e+02;5.0013304461e+02;4.9859836190e+02;4.9764042775e+02;4.9900322044e+02;5.0411488991e+02;4.9946178422e+02;4.9872279760e+02;4.9965764091e+02;4.9735511712e+02;5.0061017040e+02;5.0116636864e+02;4.9938112359e+02;5.0279613342e+02;5.0487305378e+02;5.0150200987e+02;5.0149684770e+02;4.9865078104e+02;5.0421775840e+02;5.0269934129e+02;5.0484950273e+02;5.0005248836e+02;5.0860992477e+02;5.0651133496e+02;5.0686708944e+02;5.0429990137e+02;5.0547443044e+02;5.0681838345e+02;5.0519810985e+02;5.0587816685e+02;5.0992707894e+02;5.0675194906e+02;5.0429400867e+02;5.0909874525e+02;5.0763026604e+02;5.0967356660e+02;5.0341278452e+02;5.0896439271e+02;5.1261241496e+02;5.1151173879e+02;5.0846499307e+02;5.0903967925e+02;5.1222135362e+02;5.0827723365e+02;5.1308947859e+02;5.1392767027e+02;5.0659116667e+02;5.0606883260e+02;5.1842643234e+02;5.1017636629e+02;5.0994222680e+02;5.1403987637e+02;5.1409206919e+02;5.0866524903e+02;5.1187960598e+02;5.0592813273e+02;5.0739655389e+02;5.1499977651e+02;5.2038084186e+02;5.2014458934e+02;5.2060263499e+02;5.2014585504e+02;5.2119233017e+02;5.1688988636e+02;5.1818552311e+02;5.1604165069e+02;5.2100912740e+02 +polarity=0.0000000000e+00 +seed_cut=5.0000000000e+00 +sn_cut=5.0000000000e+00 + +[beetle] +CompCtrl=9 +Ibuf=10 +Icurrbuf=102 +Ipipe=13 +Ipre=76 +Isf=26 +Isha=10 +Itp=0 +Ivoltbuf=20 +Latency=128 +ROCtrl=26 +RclkDiv=0 +Vd=130 +Vdcl=105 +Vfp=0 +Vfs=0 +mask=3 + +[calibration] +charge=30720 +delay=85 +scan_charge=true + +[charge_scan] +from=0 +nevts=100 +npts=32 +to=32768 + +[comparator] +enable=false +mode=0 +polarity=0 + +[delay_scan] +from=0 +nevts=100 +npts=32 +to=256 + +[laser] +delay=58 + +[laser_sync] +from=30 +nevts=100 +npts=100 +to=130 + +[plugin] +active_on_load=false +hook= +lang= +lib= +path= + +[trigger] +dacA=-200 +dacB=-200 +dacC=-1000 +dacD=1000 +trigger_and=false +trigger_pulse=false + diff --git a/Software/AutomatedMeasurements/CCEDelayScanConfig/CCEDelayScanConfig59ns b/Software/AutomatedMeasurements/CCEDelayScanConfig/CCEDelayScanConfig59ns new file mode 100644 index 0000000..15e4dde --- /dev/null +++ b/Software/AutomatedMeasurements/CCEDelayScanConfig/CCEDelayScanConfig59ns @@ -0,0 +1,100 @@ +[Chip.0] +Icomp=5 +Ithdelta=5 +Ithmain=0 +Vrs=0 +mask=0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0 +trim=0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0 + +[Chip.1] +Icomp=5 +Ithdelta=5 +Ithmain=0 +Vrs=0 +mask=0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0 +trim=0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0 + +[DAQ] +delay=60 +enable_busy=false +monitor_channel=60 +nevts=10000000 +pulse_shape=false +sample_size=100 + +[analysis] +common_mode=true +neigh_cut=3.0000000000e+00 +noise=2.6843330855e+00;2.1273910742e+00;2.1946251615e+00;2.1792528015e+00;2.1346342653e+00;2.1304252071e+00;2.1487249342e+00;2.0736220208e+00;2.1174789609e+00;2.1198034078e+00;2.1245570630e+00;2.0585320753e+00;2.1158707879e+00;2.1035628675e+00;2.1147651929e+00;2.1183677238e+00;2.0299088119e+00;2.0714549926e+00;2.1464597704e+00;2.0827700463e+00;2.1103596971e+00;2.1527365459e+00;2.0422459056e+00;2.0550619460e+00;2.1458496486e+00;2.0129084057e+00;2.1129166776e+00;2.0748475125e+00;2.0199038746e+00;2.0192278668e+00;2.0089812223e+00;2.0455667312e+00;2.0199711846e+00;2.0644508452e+00;2.0334754732e+00;2.0264868749e+00;2.0679373437e+00;2.0575486813e+00;2.5246167453e+00;2.2849487840e+00;2.2444611935e+00;2.2618473659e+00;2.2822960523e+00;2.2300833669e+00;2.2270217638e+00;2.2602110154e+00;2.2587938434e+00;2.2785086163e+00;2.2340218049e+00;2.2102290887e+00;2.2414892074e+00;2.2287742588e+00;2.2539047171e+00;2.2935946178e+00;2.2757571087e+00;2.2933009647e+00;2.3066359472e+00;2.2178357716e+00;2.2774014449e+00;2.2331535822e+00;2.3097200912e+00;2.2968511656e+00;2.2460881810e+00;2.3032260897e+00;2.2426884896e+00;2.2743781671e+00;2.3089276152e+00;2.2302517447e+00;2.2502334945e+00;2.2082465105e+00;2.1827418263e+00;2.2702280811e+00;2.3041227089e+00;2.2281353014e+00;2.2805403204e+00;2.2439797345e+00;2.1939761911e+00;2.2656731875e+00;2.2440102332e+00;2.2189130484e+00;2.2024802646e+00;2.1796877507e+00;2.3316672524e+00;2.2375364421e+00;2.2224127116e+00;2.2778882187e+00;2.2235481125e+00;2.1747465694e+00;2.1475871833e+00;2.1865841942e+00;2.3106695732e+00;2.1564941968e+00;2.1540223079e+00;2.2060240104e+00;2.2314730122e+00;2.2285425174e+00;2.2001150809e+00;2.1897512930e+00;2.1812992133e+00;2.2280724603e+00;2.2238907887e+00;2.1746130603e+00;2.1259962129e+00;2.1996828807e+00;2.2179409498e+00;2.1751315309e+00;2.1931362069e+00;2.1966283799e+00;2.1504023509e+00;2.1641547419e+00;2.1633034580e+00;2.2235255539e+00;2.1572500811e+00;2.2297696204e+00;2.1241692106e+00;2.1678900738e+00;2.2585326443e+00;2.2400810497e+00;2.2470774439e+00;2.3776923690e+00;2.4333540473e+00;2.3767638731e+00;2.4335602253e+00;2.4452864976e+00;2.4316591635e+00;2.4519364652e+00;2.5289088517e+00;2.5027749471e+00;2.9552434446e+00;2.2236860157e+00;2.2107692233e+00;2.2181575627e+00;2.2706272121e+00;2.1724363563e+00;2.2082511487e+00;2.2194225733e+00;2.2116654230e+00;2.1716603662e+00;2.1296240316e+00;2.1814820640e+00;2.2293810426e+00;2.2580748863e+00;2.1773905536e+00;2.1950090035e+00;2.1441214013e+00;2.1595074854e+00;2.1547883840e+00;2.1592620182e+00;2.1594497556e+00;2.1438322583e+00;2.1363396508e+00;2.1259228242e+00;2.1611819848e+00;2.1343297099e+00;2.1310930150e+00;2.1237226551e+00;2.0987900547e+00;2.0924511182e+00;2.0764110643e+00;2.0937944006e+00;2.0430946342e+00;2.1128770459e+00;2.0988310668e+00;2.0548718573e+00;2.1473216777e+00;2.1174125587e+00;2.5155207226e+00;2.2877008154e+00;2.3115647814e+00;2.3205766796e+00;2.2709295076e+00;2.2755239851e+00;2.3178613063e+00;2.2193783768e+00;2.2817564969e+00;2.2801562370e+00;2.3071472915e+00;2.2754641757e+00;2.2703997068e+00;2.2864027712e+00;2.2653832718e+00;2.2498565696e+00;2.2251863116e+00;2.1888890282e+00;2.2163118923e+00;2.2540800655e+00;2.2653822747e+00;2.2693009185e+00;2.2328056230e+00;2.3000744107e+00;2.2882022194e+00;2.2382533665e+00;2.3034007218e+00;2.2525375362e+00;2.2954146378e+00;2.2789162849e+00;2.2703436682e+00;2.2028802700e+00;2.2447750248e+00;2.3545957631e+00;2.2384958536e+00;2.3325508006e+00;2.3008619347e+00;2.3863001092e+00;2.2581739478e+00;2.3202057804e+00;2.3090684725e+00;2.2364169520e+00;2.2796298306e+00;2.3110659269e+00;2.2590609320e+00;2.3232606615e+00;2.2584415812e+00;2.2866508672e+00;2.2766000223e+00;2.2454008714e+00;2.1597176205e+00;2.2897580909e+00;2.3211823405e+00;2.2091335163e+00;2.2843053408e+00;2.2571771565e+00;2.3324958013e+00;2.2472290769e+00;2.2707404522e+00;2.2168864547e+00;2.1716565078e+00;2.2590134748e+00;2.2129370724e+00;2.2362761677e+00;2.2444464049e+00;2.2196234633e+00;2.1831947719e+00;2.2193706787e+00;2.1470405712e+00;2.1872074374e+00;2.2606681576e+00;2.1642750257e+00;2.2703142783e+00;2.2055016368e+00;2.2711679878e+00;2.1718889738e+00;2.1936323217e+00;2.2307167866e+00;2.1774147970e+00;2.2761099197e+00;2.1855890494e+00;2.3393360903e+00;2.3540839037e+00;2.3766129592e+00;2.3776303459e+00;2.4572660110e+00;2.3829220321e+00;2.4281164347e+00;2.4824068116e+00;2.4967585749e+00 +noise_weight=1.0000000000e-03 +ped_weight=1.0000000000e-02 +pedestals=5.0355398374e+02;5.0355754425e+02;5.0032817033e+02;5.0243951998e+02;4.9941854706e+02;4.9795816268e+02;4.9754152820e+02;4.9811976064e+02;4.9713286303e+02;4.9590345816e+02;4.9750235459e+02;4.9738454231e+02;4.9782480720e+02;4.9701769957e+02;4.9666167427e+02;4.9990895783e+02;5.0031739717e+02;4.9377740950e+02;4.9280647150e+02;4.9502274166e+02;4.9353396384e+02;4.9385137850e+02;5.0074396684e+02;4.9811491269e+02;4.9532433658e+02;4.9796849379e+02;5.0040054929e+02;4.9705413739e+02;4.9759214358e+02;4.9973773740e+02;4.9844751567e+02;4.9935535196e+02;4.9679074588e+02;4.9734484679e+02;4.9771451765e+02;4.9884324598e+02;4.9970384313e+02;4.9995248652e+02;4.9315262874e+02;4.9119693467e+02;4.9577793669e+02;4.9443410255e+02;4.9735958705e+02;4.9784618161e+02;4.9864431094e+02;4.9704140014e+02;4.9111966250e+02;4.9590791757e+02;4.9730789733e+02;4.9780795897e+02;4.9722689298e+02;4.9582162333e+02;4.9292815382e+02;4.9373207719e+02;4.9180550736e+02;4.9541883553e+02;4.9892841700e+02;4.9837654641e+02;4.9829221219e+02;4.9927980720e+02;4.9678879744e+02;4.9041562221e+02;4.9665364288e+02;4.9938030627e+02;4.9626856256e+02;4.9640263368e+02;4.9569493023e+02;4.9630146856e+02;4.9703875619e+02;5.0157037418e+02;4.9793479990e+02;4.9641042349e+02;4.9846638815e+02;4.9942571904e+02;5.0054139671e+02;4.9682629718e+02;4.9772493219e+02;4.9899702034e+02;4.9830730123e+02;5.0096642761e+02;4.9930342579e+02;4.9784406361e+02;4.9969253013e+02;4.9513244566e+02;4.9914975978e+02;5.0142337484e+02;5.0210404874e+02;5.0255501997e+02;4.9699012847e+02;4.9678091832e+02;5.0196622809e+02;5.0017225410e+02;4.9662210857e+02;5.0196547744e+02;4.9897621259e+02;4.9620775794e+02;4.9209692531e+02;4.9905885274e+02;4.9248138240e+02;5.0036891268e+02;5.0059799615e+02;4.9825167346e+02;4.9459704239e+02;4.9562590750e+02;4.9816595672e+02;4.9881222872e+02;4.9759810758e+02;5.0223559772e+02;5.0271469623e+02;5.0178510965e+02;4.9384854702e+02;5.0078740962e+02;4.9695185802e+02;5.0043807101e+02;4.9957882252e+02;5.0144438688e+02;5.0119258813e+02;5.0816683898e+02;5.0645829290e+02;5.0767212022e+02;5.1207726898e+02;5.0802103923e+02;5.0957878015e+02;5.1570196490e+02;5.0892889781e+02;5.0670900600e+02;5.0584312216e+02;5.1292362390e+02;5.0813562062e+02;5.0864338860e+02;5.0784200448e+02;5.0501667382e+02;5.0696882864e+02;5.0989227617e+02;5.0468170725e+02;5.0601937979e+02;5.0603936521e+02;5.0652279702e+02;5.0221793527e+02;5.0245970428e+02;5.0343441573e+02;5.0323159384e+02;5.0346802496e+02;5.0555290015e+02;5.1083601202e+02;5.0507814125e+02;5.0917491703e+02;5.0660007785e+02;5.0683373056e+02;5.0826038561e+02;5.0744563605e+02;5.0500389862e+02;5.0969013531e+02;5.0575155765e+02;5.0948947872e+02;5.0530541186e+02;5.0110755466e+02;5.0331062117e+02;5.0650396812e+02;5.0583777387e+02;5.0133886575e+02;5.0560239667e+02;5.0317212624e+02;5.0227882152e+02;5.0216882791e+02;5.0424604553e+02;4.9794110852e+02;4.9763392151e+02;5.0207175155e+02;4.9913319495e+02;4.9771413224e+02;4.9602556354e+02;5.0038559402e+02;4.9713693327e+02;4.9800179035e+02;4.9711527574e+02;4.9971216390e+02;5.0104739252e+02;4.9762885508e+02;4.9718186032e+02;4.9983704711e+02;5.0018342187e+02;5.0928970398e+02;5.0171279938e+02;5.0271038955e+02;5.0359302306e+02;5.0405965696e+02;5.0019749570e+02;5.0483950858e+02;4.9701573545e+02;5.0013304461e+02;4.9859836190e+02;4.9764042775e+02;4.9900322044e+02;5.0411488991e+02;4.9946178422e+02;4.9872279760e+02;4.9965764091e+02;4.9735511712e+02;5.0061017040e+02;5.0116636864e+02;4.9938112359e+02;5.0279613342e+02;5.0487305378e+02;5.0150200987e+02;5.0149684770e+02;4.9865078104e+02;5.0421775840e+02;5.0269934129e+02;5.0484950273e+02;5.0005248836e+02;5.0860992477e+02;5.0651133496e+02;5.0686708944e+02;5.0429990137e+02;5.0547443044e+02;5.0681838345e+02;5.0519810985e+02;5.0587816685e+02;5.0992707894e+02;5.0675194906e+02;5.0429400867e+02;5.0909874525e+02;5.0763026604e+02;5.0967356660e+02;5.0341278452e+02;5.0896439271e+02;5.1261241496e+02;5.1151173879e+02;5.0846499307e+02;5.0903967925e+02;5.1222135362e+02;5.0827723365e+02;5.1308947859e+02;5.1392767027e+02;5.0659116667e+02;5.0606883260e+02;5.1842643234e+02;5.1017636629e+02;5.0994222680e+02;5.1403987637e+02;5.1409206919e+02;5.0866524903e+02;5.1187960598e+02;5.0592813273e+02;5.0739655389e+02;5.1499977651e+02;5.2038084186e+02;5.2014458934e+02;5.2060263499e+02;5.2014585504e+02;5.2119233017e+02;5.1688988636e+02;5.1818552311e+02;5.1604165069e+02;5.2100912740e+02 +polarity=0.0000000000e+00 +seed_cut=5.0000000000e+00 +sn_cut=5.0000000000e+00 + +[beetle] +CompCtrl=9 +Ibuf=10 +Icurrbuf=102 +Ipipe=13 +Ipre=76 +Isf=26 +Isha=10 +Itp=0 +Ivoltbuf=20 +Latency=128 +ROCtrl=26 +RclkDiv=0 +Vd=130 +Vdcl=105 +Vfp=0 +Vfs=0 +mask=3 + +[calibration] +charge=30720 +delay=85 +scan_charge=true + +[charge_scan] +from=0 +nevts=100 +npts=32 +to=32768 + +[comparator] +enable=false +mode=0 +polarity=0 + +[delay_scan] +from=0 +nevts=100 +npts=32 +to=256 + +[laser] +delay=59 + +[laser_sync] +from=30 +nevts=100 +npts=100 +to=130 + +[plugin] +active_on_load=false +hook= +lang= +lib= +path= + +[trigger] +dacA=-200 +dacB=-200 +dacC=-1000 +dacD=1000 +trigger_and=false +trigger_pulse=false + diff --git a/Software/AutomatedMeasurements/CCEDelayScanConfig/CCEDelayScanConfig60ns b/Software/AutomatedMeasurements/CCEDelayScanConfig/CCEDelayScanConfig60ns new file mode 100644 index 0000000..4498e42 --- /dev/null +++ b/Software/AutomatedMeasurements/CCEDelayScanConfig/CCEDelayScanConfig60ns @@ -0,0 +1,100 @@ +[Chip.0] +Icomp=5 +Ithdelta=5 +Ithmain=0 +Vrs=0 +mask=0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0 +trim=0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0 + +[Chip.1] +Icomp=5 +Ithdelta=5 +Ithmain=0 +Vrs=0 +mask=0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0 +trim=0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0 + +[DAQ] +delay=60 +enable_busy=false +monitor_channel=60 +nevts=10000000 +pulse_shape=false +sample_size=100 + +[analysis] +common_mode=true +neigh_cut=3.0000000000e+00 +noise=2.6843330855e+00;2.1273910742e+00;2.1946251615e+00;2.1792528015e+00;2.1346342653e+00;2.1304252071e+00;2.1487249342e+00;2.0736220208e+00;2.1174789609e+00;2.1198034078e+00;2.1245570630e+00;2.0585320753e+00;2.1158707879e+00;2.1035628675e+00;2.1147651929e+00;2.1183677238e+00;2.0299088119e+00;2.0714549926e+00;2.1464597704e+00;2.0827700463e+00;2.1103596971e+00;2.1527365459e+00;2.0422459056e+00;2.0550619460e+00;2.1458496486e+00;2.0129084057e+00;2.1129166776e+00;2.0748475125e+00;2.0199038746e+00;2.0192278668e+00;2.0089812223e+00;2.0455667312e+00;2.0199711846e+00;2.0644508452e+00;2.0334754732e+00;2.0264868749e+00;2.0679373437e+00;2.0575486813e+00;2.5246167453e+00;2.2849487840e+00;2.2444611935e+00;2.2618473659e+00;2.2822960523e+00;2.2300833669e+00;2.2270217638e+00;2.2602110154e+00;2.2587938434e+00;2.2785086163e+00;2.2340218049e+00;2.2102290887e+00;2.2414892074e+00;2.2287742588e+00;2.2539047171e+00;2.2935946178e+00;2.2757571087e+00;2.2933009647e+00;2.3066359472e+00;2.2178357716e+00;2.2774014449e+00;2.2331535822e+00;2.3097200912e+00;2.2968511656e+00;2.2460881810e+00;2.3032260897e+00;2.2426884896e+00;2.2743781671e+00;2.3089276152e+00;2.2302517447e+00;2.2502334945e+00;2.2082465105e+00;2.1827418263e+00;2.2702280811e+00;2.3041227089e+00;2.2281353014e+00;2.2805403204e+00;2.2439797345e+00;2.1939761911e+00;2.2656731875e+00;2.2440102332e+00;2.2189130484e+00;2.2024802646e+00;2.1796877507e+00;2.3316672524e+00;2.2375364421e+00;2.2224127116e+00;2.2778882187e+00;2.2235481125e+00;2.1747465694e+00;2.1475871833e+00;2.1865841942e+00;2.3106695732e+00;2.1564941968e+00;2.1540223079e+00;2.2060240104e+00;2.2314730122e+00;2.2285425174e+00;2.2001150809e+00;2.1897512930e+00;2.1812992133e+00;2.2280724603e+00;2.2238907887e+00;2.1746130603e+00;2.1259962129e+00;2.1996828807e+00;2.2179409498e+00;2.1751315309e+00;2.1931362069e+00;2.1966283799e+00;2.1504023509e+00;2.1641547419e+00;2.1633034580e+00;2.2235255539e+00;2.1572500811e+00;2.2297696204e+00;2.1241692106e+00;2.1678900738e+00;2.2585326443e+00;2.2400810497e+00;2.2470774439e+00;2.3776923690e+00;2.4333540473e+00;2.3767638731e+00;2.4335602253e+00;2.4452864976e+00;2.4316591635e+00;2.4519364652e+00;2.5289088517e+00;2.5027749471e+00;2.9552434446e+00;2.2236860157e+00;2.2107692233e+00;2.2181575627e+00;2.2706272121e+00;2.1724363563e+00;2.2082511487e+00;2.2194225733e+00;2.2116654230e+00;2.1716603662e+00;2.1296240316e+00;2.1814820640e+00;2.2293810426e+00;2.2580748863e+00;2.1773905536e+00;2.1950090035e+00;2.1441214013e+00;2.1595074854e+00;2.1547883840e+00;2.1592620182e+00;2.1594497556e+00;2.1438322583e+00;2.1363396508e+00;2.1259228242e+00;2.1611819848e+00;2.1343297099e+00;2.1310930150e+00;2.1237226551e+00;2.0987900547e+00;2.0924511182e+00;2.0764110643e+00;2.0937944006e+00;2.0430946342e+00;2.1128770459e+00;2.0988310668e+00;2.0548718573e+00;2.1473216777e+00;2.1174125587e+00;2.5155207226e+00;2.2877008154e+00;2.3115647814e+00;2.3205766796e+00;2.2709295076e+00;2.2755239851e+00;2.3178613063e+00;2.2193783768e+00;2.2817564969e+00;2.2801562370e+00;2.3071472915e+00;2.2754641757e+00;2.2703997068e+00;2.2864027712e+00;2.2653832718e+00;2.2498565696e+00;2.2251863116e+00;2.1888890282e+00;2.2163118923e+00;2.2540800655e+00;2.2653822747e+00;2.2693009185e+00;2.2328056230e+00;2.3000744107e+00;2.2882022194e+00;2.2382533665e+00;2.3034007218e+00;2.2525375362e+00;2.2954146378e+00;2.2789162849e+00;2.2703436682e+00;2.2028802700e+00;2.2447750248e+00;2.3545957631e+00;2.2384958536e+00;2.3325508006e+00;2.3008619347e+00;2.3863001092e+00;2.2581739478e+00;2.3202057804e+00;2.3090684725e+00;2.2364169520e+00;2.2796298306e+00;2.3110659269e+00;2.2590609320e+00;2.3232606615e+00;2.2584415812e+00;2.2866508672e+00;2.2766000223e+00;2.2454008714e+00;2.1597176205e+00;2.2897580909e+00;2.3211823405e+00;2.2091335163e+00;2.2843053408e+00;2.2571771565e+00;2.3324958013e+00;2.2472290769e+00;2.2707404522e+00;2.2168864547e+00;2.1716565078e+00;2.2590134748e+00;2.2129370724e+00;2.2362761677e+00;2.2444464049e+00;2.2196234633e+00;2.1831947719e+00;2.2193706787e+00;2.1470405712e+00;2.1872074374e+00;2.2606681576e+00;2.1642750257e+00;2.2703142783e+00;2.2055016368e+00;2.2711679878e+00;2.1718889738e+00;2.1936323217e+00;2.2307167866e+00;2.1774147970e+00;2.2761099197e+00;2.1855890494e+00;2.3393360903e+00;2.3540839037e+00;2.3766129592e+00;2.3776303459e+00;2.4572660110e+00;2.3829220321e+00;2.4281164347e+00;2.4824068116e+00;2.4967585749e+00 +noise_weight=1.0000000000e-03 +ped_weight=1.0000000000e-02 +pedestals=5.0355398374e+02;5.0355754425e+02;5.0032817033e+02;5.0243951998e+02;4.9941854706e+02;4.9795816268e+02;4.9754152820e+02;4.9811976064e+02;4.9713286303e+02;4.9590345816e+02;4.9750235459e+02;4.9738454231e+02;4.9782480720e+02;4.9701769957e+02;4.9666167427e+02;4.9990895783e+02;5.0031739717e+02;4.9377740950e+02;4.9280647150e+02;4.9502274166e+02;4.9353396384e+02;4.9385137850e+02;5.0074396684e+02;4.9811491269e+02;4.9532433658e+02;4.9796849379e+02;5.0040054929e+02;4.9705413739e+02;4.9759214358e+02;4.9973773740e+02;4.9844751567e+02;4.9935535196e+02;4.9679074588e+02;4.9734484679e+02;4.9771451765e+02;4.9884324598e+02;4.9970384313e+02;4.9995248652e+02;4.9315262874e+02;4.9119693467e+02;4.9577793669e+02;4.9443410255e+02;4.9735958705e+02;4.9784618161e+02;4.9864431094e+02;4.9704140014e+02;4.9111966250e+02;4.9590791757e+02;4.9730789733e+02;4.9780795897e+02;4.9722689298e+02;4.9582162333e+02;4.9292815382e+02;4.9373207719e+02;4.9180550736e+02;4.9541883553e+02;4.9892841700e+02;4.9837654641e+02;4.9829221219e+02;4.9927980720e+02;4.9678879744e+02;4.9041562221e+02;4.9665364288e+02;4.9938030627e+02;4.9626856256e+02;4.9640263368e+02;4.9569493023e+02;4.9630146856e+02;4.9703875619e+02;5.0157037418e+02;4.9793479990e+02;4.9641042349e+02;4.9846638815e+02;4.9942571904e+02;5.0054139671e+02;4.9682629718e+02;4.9772493219e+02;4.9899702034e+02;4.9830730123e+02;5.0096642761e+02;4.9930342579e+02;4.9784406361e+02;4.9969253013e+02;4.9513244566e+02;4.9914975978e+02;5.0142337484e+02;5.0210404874e+02;5.0255501997e+02;4.9699012847e+02;4.9678091832e+02;5.0196622809e+02;5.0017225410e+02;4.9662210857e+02;5.0196547744e+02;4.9897621259e+02;4.9620775794e+02;4.9209692531e+02;4.9905885274e+02;4.9248138240e+02;5.0036891268e+02;5.0059799615e+02;4.9825167346e+02;4.9459704239e+02;4.9562590750e+02;4.9816595672e+02;4.9881222872e+02;4.9759810758e+02;5.0223559772e+02;5.0271469623e+02;5.0178510965e+02;4.9384854702e+02;5.0078740962e+02;4.9695185802e+02;5.0043807101e+02;4.9957882252e+02;5.0144438688e+02;5.0119258813e+02;5.0816683898e+02;5.0645829290e+02;5.0767212022e+02;5.1207726898e+02;5.0802103923e+02;5.0957878015e+02;5.1570196490e+02;5.0892889781e+02;5.0670900600e+02;5.0584312216e+02;5.1292362390e+02;5.0813562062e+02;5.0864338860e+02;5.0784200448e+02;5.0501667382e+02;5.0696882864e+02;5.0989227617e+02;5.0468170725e+02;5.0601937979e+02;5.0603936521e+02;5.0652279702e+02;5.0221793527e+02;5.0245970428e+02;5.0343441573e+02;5.0323159384e+02;5.0346802496e+02;5.0555290015e+02;5.1083601202e+02;5.0507814125e+02;5.0917491703e+02;5.0660007785e+02;5.0683373056e+02;5.0826038561e+02;5.0744563605e+02;5.0500389862e+02;5.0969013531e+02;5.0575155765e+02;5.0948947872e+02;5.0530541186e+02;5.0110755466e+02;5.0331062117e+02;5.0650396812e+02;5.0583777387e+02;5.0133886575e+02;5.0560239667e+02;5.0317212624e+02;5.0227882152e+02;5.0216882791e+02;5.0424604553e+02;4.9794110852e+02;4.9763392151e+02;5.0207175155e+02;4.9913319495e+02;4.9771413224e+02;4.9602556354e+02;5.0038559402e+02;4.9713693327e+02;4.9800179035e+02;4.9711527574e+02;4.9971216390e+02;5.0104739252e+02;4.9762885508e+02;4.9718186032e+02;4.9983704711e+02;5.0018342187e+02;5.0928970398e+02;5.0171279938e+02;5.0271038955e+02;5.0359302306e+02;5.0405965696e+02;5.0019749570e+02;5.0483950858e+02;4.9701573545e+02;5.0013304461e+02;4.9859836190e+02;4.9764042775e+02;4.9900322044e+02;5.0411488991e+02;4.9946178422e+02;4.9872279760e+02;4.9965764091e+02;4.9735511712e+02;5.0061017040e+02;5.0116636864e+02;4.9938112359e+02;5.0279613342e+02;5.0487305378e+02;5.0150200987e+02;5.0149684770e+02;4.9865078104e+02;5.0421775840e+02;5.0269934129e+02;5.0484950273e+02;5.0005248836e+02;5.0860992477e+02;5.0651133496e+02;5.0686708944e+02;5.0429990137e+02;5.0547443044e+02;5.0681838345e+02;5.0519810985e+02;5.0587816685e+02;5.0992707894e+02;5.0675194906e+02;5.0429400867e+02;5.0909874525e+02;5.0763026604e+02;5.0967356660e+02;5.0341278452e+02;5.0896439271e+02;5.1261241496e+02;5.1151173879e+02;5.0846499307e+02;5.0903967925e+02;5.1222135362e+02;5.0827723365e+02;5.1308947859e+02;5.1392767027e+02;5.0659116667e+02;5.0606883260e+02;5.1842643234e+02;5.1017636629e+02;5.0994222680e+02;5.1403987637e+02;5.1409206919e+02;5.0866524903e+02;5.1187960598e+02;5.0592813273e+02;5.0739655389e+02;5.1499977651e+02;5.2038084186e+02;5.2014458934e+02;5.2060263499e+02;5.2014585504e+02;5.2119233017e+02;5.1688988636e+02;5.1818552311e+02;5.1604165069e+02;5.2100912740e+02 +polarity=0.0000000000e+00 +seed_cut=5.0000000000e+00 +sn_cut=5.0000000000e+00 + +[beetle] +CompCtrl=9 +Ibuf=10 +Icurrbuf=102 +Ipipe=13 +Ipre=76 +Isf=26 +Isha=10 +Itp=0 +Ivoltbuf=20 +Latency=128 +ROCtrl=26 +RclkDiv=0 +Vd=130 +Vdcl=105 +Vfp=0 +Vfs=0 +mask=3 + +[calibration] +charge=30720 +delay=85 +scan_charge=true + +[charge_scan] +from=0 +nevts=100 +npts=32 +to=32768 + +[comparator] +enable=false +mode=0 +polarity=0 + +[delay_scan] +from=0 +nevts=100 +npts=32 +to=256 + +[laser] +delay=60 + +[laser_sync] +from=30 +nevts=100 +npts=100 +to=130 + +[plugin] +active_on_load=false +hook= +lang= +lib= +path= + +[trigger] +dacA=-200 +dacB=-200 +dacC=-1000 +dacD=1000 +trigger_and=false +trigger_pulse=false + diff --git a/Software/AutomatedMeasurements/CCEDelayScanConfig/CCEDelayScanConfig61ns b/Software/AutomatedMeasurements/CCEDelayScanConfig/CCEDelayScanConfig61ns new file mode 100644 index 0000000..9d46186 --- /dev/null +++ b/Software/AutomatedMeasurements/CCEDelayScanConfig/CCEDelayScanConfig61ns @@ -0,0 +1,100 @@ +[Chip.0] +Icomp=5 +Ithdelta=5 +Ithmain=0 +Vrs=0 +mask=0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0 +trim=0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0 + +[Chip.1] +Icomp=5 +Ithdelta=5 +Ithmain=0 +Vrs=0 +mask=0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0 +trim=0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0 + +[DAQ] +delay=60 +enable_busy=false +monitor_channel=60 +nevts=10000000 +pulse_shape=false +sample_size=100 + +[analysis] +common_mode=true +neigh_cut=3.0000000000e+00 +noise=2.6843330855e+00;2.1273910742e+00;2.1946251615e+00;2.1792528015e+00;2.1346342653e+00;2.1304252071e+00;2.1487249342e+00;2.0736220208e+00;2.1174789609e+00;2.1198034078e+00;2.1245570630e+00;2.0585320753e+00;2.1158707879e+00;2.1035628675e+00;2.1147651929e+00;2.1183677238e+00;2.0299088119e+00;2.0714549926e+00;2.1464597704e+00;2.0827700463e+00;2.1103596971e+00;2.1527365459e+00;2.0422459056e+00;2.0550619460e+00;2.1458496486e+00;2.0129084057e+00;2.1129166776e+00;2.0748475125e+00;2.0199038746e+00;2.0192278668e+00;2.0089812223e+00;2.0455667312e+00;2.0199711846e+00;2.0644508452e+00;2.0334754732e+00;2.0264868749e+00;2.0679373437e+00;2.0575486813e+00;2.5246167453e+00;2.2849487840e+00;2.2444611935e+00;2.2618473659e+00;2.2822960523e+00;2.2300833669e+00;2.2270217638e+00;2.2602110154e+00;2.2587938434e+00;2.2785086163e+00;2.2340218049e+00;2.2102290887e+00;2.2414892074e+00;2.2287742588e+00;2.2539047171e+00;2.2935946178e+00;2.2757571087e+00;2.2933009647e+00;2.3066359472e+00;2.2178357716e+00;2.2774014449e+00;2.2331535822e+00;2.3097200912e+00;2.2968511656e+00;2.2460881810e+00;2.3032260897e+00;2.2426884896e+00;2.2743781671e+00;2.3089276152e+00;2.2302517447e+00;2.2502334945e+00;2.2082465105e+00;2.1827418263e+00;2.2702280811e+00;2.3041227089e+00;2.2281353014e+00;2.2805403204e+00;2.2439797345e+00;2.1939761911e+00;2.2656731875e+00;2.2440102332e+00;2.2189130484e+00;2.2024802646e+00;2.1796877507e+00;2.3316672524e+00;2.2375364421e+00;2.2224127116e+00;2.2778882187e+00;2.2235481125e+00;2.1747465694e+00;2.1475871833e+00;2.1865841942e+00;2.3106695732e+00;2.1564941968e+00;2.1540223079e+00;2.2060240104e+00;2.2314730122e+00;2.2285425174e+00;2.2001150809e+00;2.1897512930e+00;2.1812992133e+00;2.2280724603e+00;2.2238907887e+00;2.1746130603e+00;2.1259962129e+00;2.1996828807e+00;2.2179409498e+00;2.1751315309e+00;2.1931362069e+00;2.1966283799e+00;2.1504023509e+00;2.1641547419e+00;2.1633034580e+00;2.2235255539e+00;2.1572500811e+00;2.2297696204e+00;2.1241692106e+00;2.1678900738e+00;2.2585326443e+00;2.2400810497e+00;2.2470774439e+00;2.3776923690e+00;2.4333540473e+00;2.3767638731e+00;2.4335602253e+00;2.4452864976e+00;2.4316591635e+00;2.4519364652e+00;2.5289088517e+00;2.5027749471e+00;2.9552434446e+00;2.2236860157e+00;2.2107692233e+00;2.2181575627e+00;2.2706272121e+00;2.1724363563e+00;2.2082511487e+00;2.2194225733e+00;2.2116654230e+00;2.1716603662e+00;2.1296240316e+00;2.1814820640e+00;2.2293810426e+00;2.2580748863e+00;2.1773905536e+00;2.1950090035e+00;2.1441214013e+00;2.1595074854e+00;2.1547883840e+00;2.1592620182e+00;2.1594497556e+00;2.1438322583e+00;2.1363396508e+00;2.1259228242e+00;2.1611819848e+00;2.1343297099e+00;2.1310930150e+00;2.1237226551e+00;2.0987900547e+00;2.0924511182e+00;2.0764110643e+00;2.0937944006e+00;2.0430946342e+00;2.1128770459e+00;2.0988310668e+00;2.0548718573e+00;2.1473216777e+00;2.1174125587e+00;2.5155207226e+00;2.2877008154e+00;2.3115647814e+00;2.3205766796e+00;2.2709295076e+00;2.2755239851e+00;2.3178613063e+00;2.2193783768e+00;2.2817564969e+00;2.2801562370e+00;2.3071472915e+00;2.2754641757e+00;2.2703997068e+00;2.2864027712e+00;2.2653832718e+00;2.2498565696e+00;2.2251863116e+00;2.1888890282e+00;2.2163118923e+00;2.2540800655e+00;2.2653822747e+00;2.2693009185e+00;2.2328056230e+00;2.3000744107e+00;2.2882022194e+00;2.2382533665e+00;2.3034007218e+00;2.2525375362e+00;2.2954146378e+00;2.2789162849e+00;2.2703436682e+00;2.2028802700e+00;2.2447750248e+00;2.3545957631e+00;2.2384958536e+00;2.3325508006e+00;2.3008619347e+00;2.3863001092e+00;2.2581739478e+00;2.3202057804e+00;2.3090684725e+00;2.2364169520e+00;2.2796298306e+00;2.3110659269e+00;2.2590609320e+00;2.3232606615e+00;2.2584415812e+00;2.2866508672e+00;2.2766000223e+00;2.2454008714e+00;2.1597176205e+00;2.2897580909e+00;2.3211823405e+00;2.2091335163e+00;2.2843053408e+00;2.2571771565e+00;2.3324958013e+00;2.2472290769e+00;2.2707404522e+00;2.2168864547e+00;2.1716565078e+00;2.2590134748e+00;2.2129370724e+00;2.2362761677e+00;2.2444464049e+00;2.2196234633e+00;2.1831947719e+00;2.2193706787e+00;2.1470405712e+00;2.1872074374e+00;2.2606681576e+00;2.1642750257e+00;2.2703142783e+00;2.2055016368e+00;2.2711679878e+00;2.1718889738e+00;2.1936323217e+00;2.2307167866e+00;2.1774147970e+00;2.2761099197e+00;2.1855890494e+00;2.3393360903e+00;2.3540839037e+00;2.3766129592e+00;2.3776303459e+00;2.4572660110e+00;2.3829220321e+00;2.4281164347e+00;2.4824068116e+00;2.4967585749e+00 +noise_weight=1.0000000000e-03 +ped_weight=1.0000000000e-02 +pedestals=5.0355398374e+02;5.0355754425e+02;5.0032817033e+02;5.0243951998e+02;4.9941854706e+02;4.9795816268e+02;4.9754152820e+02;4.9811976064e+02;4.9713286303e+02;4.9590345816e+02;4.9750235459e+02;4.9738454231e+02;4.9782480720e+02;4.9701769957e+02;4.9666167427e+02;4.9990895783e+02;5.0031739717e+02;4.9377740950e+02;4.9280647150e+02;4.9502274166e+02;4.9353396384e+02;4.9385137850e+02;5.0074396684e+02;4.9811491269e+02;4.9532433658e+02;4.9796849379e+02;5.0040054929e+02;4.9705413739e+02;4.9759214358e+02;4.9973773740e+02;4.9844751567e+02;4.9935535196e+02;4.9679074588e+02;4.9734484679e+02;4.9771451765e+02;4.9884324598e+02;4.9970384313e+02;4.9995248652e+02;4.9315262874e+02;4.9119693467e+02;4.9577793669e+02;4.9443410255e+02;4.9735958705e+02;4.9784618161e+02;4.9864431094e+02;4.9704140014e+02;4.9111966250e+02;4.9590791757e+02;4.9730789733e+02;4.9780795897e+02;4.9722689298e+02;4.9582162333e+02;4.9292815382e+02;4.9373207719e+02;4.9180550736e+02;4.9541883553e+02;4.9892841700e+02;4.9837654641e+02;4.9829221219e+02;4.9927980720e+02;4.9678879744e+02;4.9041562221e+02;4.9665364288e+02;4.9938030627e+02;4.9626856256e+02;4.9640263368e+02;4.9569493023e+02;4.9630146856e+02;4.9703875619e+02;5.0157037418e+02;4.9793479990e+02;4.9641042349e+02;4.9846638815e+02;4.9942571904e+02;5.0054139671e+02;4.9682629718e+02;4.9772493219e+02;4.9899702034e+02;4.9830730123e+02;5.0096642761e+02;4.9930342579e+02;4.9784406361e+02;4.9969253013e+02;4.9513244566e+02;4.9914975978e+02;5.0142337484e+02;5.0210404874e+02;5.0255501997e+02;4.9699012847e+02;4.9678091832e+02;5.0196622809e+02;5.0017225410e+02;4.9662210857e+02;5.0196547744e+02;4.9897621259e+02;4.9620775794e+02;4.9209692531e+02;4.9905885274e+02;4.9248138240e+02;5.0036891268e+02;5.0059799615e+02;4.9825167346e+02;4.9459704239e+02;4.9562590750e+02;4.9816595672e+02;4.9881222872e+02;4.9759810758e+02;5.0223559772e+02;5.0271469623e+02;5.0178510965e+02;4.9384854702e+02;5.0078740962e+02;4.9695185802e+02;5.0043807101e+02;4.9957882252e+02;5.0144438688e+02;5.0119258813e+02;5.0816683898e+02;5.0645829290e+02;5.0767212022e+02;5.1207726898e+02;5.0802103923e+02;5.0957878015e+02;5.1570196490e+02;5.0892889781e+02;5.0670900600e+02;5.0584312216e+02;5.1292362390e+02;5.0813562062e+02;5.0864338860e+02;5.0784200448e+02;5.0501667382e+02;5.0696882864e+02;5.0989227617e+02;5.0468170725e+02;5.0601937979e+02;5.0603936521e+02;5.0652279702e+02;5.0221793527e+02;5.0245970428e+02;5.0343441573e+02;5.0323159384e+02;5.0346802496e+02;5.0555290015e+02;5.1083601202e+02;5.0507814125e+02;5.0917491703e+02;5.0660007785e+02;5.0683373056e+02;5.0826038561e+02;5.0744563605e+02;5.0500389862e+02;5.0969013531e+02;5.0575155765e+02;5.0948947872e+02;5.0530541186e+02;5.0110755466e+02;5.0331062117e+02;5.0650396812e+02;5.0583777387e+02;5.0133886575e+02;5.0560239667e+02;5.0317212624e+02;5.0227882152e+02;5.0216882791e+02;5.0424604553e+02;4.9794110852e+02;4.9763392151e+02;5.0207175155e+02;4.9913319495e+02;4.9771413224e+02;4.9602556354e+02;5.0038559402e+02;4.9713693327e+02;4.9800179035e+02;4.9711527574e+02;4.9971216390e+02;5.0104739252e+02;4.9762885508e+02;4.9718186032e+02;4.9983704711e+02;5.0018342187e+02;5.0928970398e+02;5.0171279938e+02;5.0271038955e+02;5.0359302306e+02;5.0405965696e+02;5.0019749570e+02;5.0483950858e+02;4.9701573545e+02;5.0013304461e+02;4.9859836190e+02;4.9764042775e+02;4.9900322044e+02;5.0411488991e+02;4.9946178422e+02;4.9872279760e+02;4.9965764091e+02;4.9735511712e+02;5.0061017040e+02;5.0116636864e+02;4.9938112359e+02;5.0279613342e+02;5.0487305378e+02;5.0150200987e+02;5.0149684770e+02;4.9865078104e+02;5.0421775840e+02;5.0269934129e+02;5.0484950273e+02;5.0005248836e+02;5.0860992477e+02;5.0651133496e+02;5.0686708944e+02;5.0429990137e+02;5.0547443044e+02;5.0681838345e+02;5.0519810985e+02;5.0587816685e+02;5.0992707894e+02;5.0675194906e+02;5.0429400867e+02;5.0909874525e+02;5.0763026604e+02;5.0967356660e+02;5.0341278452e+02;5.0896439271e+02;5.1261241496e+02;5.1151173879e+02;5.0846499307e+02;5.0903967925e+02;5.1222135362e+02;5.0827723365e+02;5.1308947859e+02;5.1392767027e+02;5.0659116667e+02;5.0606883260e+02;5.1842643234e+02;5.1017636629e+02;5.0994222680e+02;5.1403987637e+02;5.1409206919e+02;5.0866524903e+02;5.1187960598e+02;5.0592813273e+02;5.0739655389e+02;5.1499977651e+02;5.2038084186e+02;5.2014458934e+02;5.2060263499e+02;5.2014585504e+02;5.2119233017e+02;5.1688988636e+02;5.1818552311e+02;5.1604165069e+02;5.2100912740e+02 +polarity=0.0000000000e+00 +seed_cut=5.0000000000e+00 +sn_cut=5.0000000000e+00 + +[beetle] +CompCtrl=9 +Ibuf=10 +Icurrbuf=102 +Ipipe=13 +Ipre=76 +Isf=26 +Isha=10 +Itp=0 +Ivoltbuf=20 +Latency=128 +ROCtrl=26 +RclkDiv=0 +Vd=130 +Vdcl=105 +Vfp=0 +Vfs=0 +mask=3 + +[calibration] +charge=30720 +delay=85 +scan_charge=true + +[charge_scan] +from=0 +nevts=100 +npts=32 +to=32768 + +[comparator] +enable=false +mode=0 +polarity=0 + +[delay_scan] +from=0 +nevts=100 +npts=32 +to=256 + +[laser] +delay=61 + +[laser_sync] +from=30 +nevts=100 +npts=100 +to=130 + +[plugin] +active_on_load=false +hook= +lang= +lib= +path= + +[trigger] +dacA=-200 +dacB=-200 +dacC=-1000 +dacD=1000 +trigger_and=false +trigger_pulse=false + diff --git a/Software/AutomatedMeasurements/CCEDelayScanConfig/CCEDelayScanConfig62ns b/Software/AutomatedMeasurements/CCEDelayScanConfig/CCEDelayScanConfig62ns new file mode 100644 index 0000000..a1d204f --- /dev/null +++ b/Software/AutomatedMeasurements/CCEDelayScanConfig/CCEDelayScanConfig62ns @@ -0,0 +1,100 @@ +[Chip.0] +Icomp=5 +Ithdelta=5 +Ithmain=0 +Vrs=0 +mask=0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0 +trim=0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0 + +[Chip.1] +Icomp=5 +Ithdelta=5 +Ithmain=0 +Vrs=0 +mask=0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0 +trim=0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0 + +[DAQ] +delay=60 +enable_busy=false +monitor_channel=60 +nevts=10000000 +pulse_shape=false +sample_size=100 + +[analysis] +common_mode=true +neigh_cut=3.0000000000e+00 +noise=2.6843330855e+00;2.1273910742e+00;2.1946251615e+00;2.1792528015e+00;2.1346342653e+00;2.1304252071e+00;2.1487249342e+00;2.0736220208e+00;2.1174789609e+00;2.1198034078e+00;2.1245570630e+00;2.0585320753e+00;2.1158707879e+00;2.1035628675e+00;2.1147651929e+00;2.1183677238e+00;2.0299088119e+00;2.0714549926e+00;2.1464597704e+00;2.0827700463e+00;2.1103596971e+00;2.1527365459e+00;2.0422459056e+00;2.0550619460e+00;2.1458496486e+00;2.0129084057e+00;2.1129166776e+00;2.0748475125e+00;2.0199038746e+00;2.0192278668e+00;2.0089812223e+00;2.0455667312e+00;2.0199711846e+00;2.0644508452e+00;2.0334754732e+00;2.0264868749e+00;2.0679373437e+00;2.0575486813e+00;2.5246167453e+00;2.2849487840e+00;2.2444611935e+00;2.2618473659e+00;2.2822960523e+00;2.2300833669e+00;2.2270217638e+00;2.2602110154e+00;2.2587938434e+00;2.2785086163e+00;2.2340218049e+00;2.2102290887e+00;2.2414892074e+00;2.2287742588e+00;2.2539047171e+00;2.2935946178e+00;2.2757571087e+00;2.2933009647e+00;2.3066359472e+00;2.2178357716e+00;2.2774014449e+00;2.2331535822e+00;2.3097200912e+00;2.2968511656e+00;2.2460881810e+00;2.3032260897e+00;2.2426884896e+00;2.2743781671e+00;2.3089276152e+00;2.2302517447e+00;2.2502334945e+00;2.2082465105e+00;2.1827418263e+00;2.2702280811e+00;2.3041227089e+00;2.2281353014e+00;2.2805403204e+00;2.2439797345e+00;2.1939761911e+00;2.2656731875e+00;2.2440102332e+00;2.2189130484e+00;2.2024802646e+00;2.1796877507e+00;2.3316672524e+00;2.2375364421e+00;2.2224127116e+00;2.2778882187e+00;2.2235481125e+00;2.1747465694e+00;2.1475871833e+00;2.1865841942e+00;2.3106695732e+00;2.1564941968e+00;2.1540223079e+00;2.2060240104e+00;2.2314730122e+00;2.2285425174e+00;2.2001150809e+00;2.1897512930e+00;2.1812992133e+00;2.2280724603e+00;2.2238907887e+00;2.1746130603e+00;2.1259962129e+00;2.1996828807e+00;2.2179409498e+00;2.1751315309e+00;2.1931362069e+00;2.1966283799e+00;2.1504023509e+00;2.1641547419e+00;2.1633034580e+00;2.2235255539e+00;2.1572500811e+00;2.2297696204e+00;2.1241692106e+00;2.1678900738e+00;2.2585326443e+00;2.2400810497e+00;2.2470774439e+00;2.3776923690e+00;2.4333540473e+00;2.3767638731e+00;2.4335602253e+00;2.4452864976e+00;2.4316591635e+00;2.4519364652e+00;2.5289088517e+00;2.5027749471e+00;2.9552434446e+00;2.2236860157e+00;2.2107692233e+00;2.2181575627e+00;2.2706272121e+00;2.1724363563e+00;2.2082511487e+00;2.2194225733e+00;2.2116654230e+00;2.1716603662e+00;2.1296240316e+00;2.1814820640e+00;2.2293810426e+00;2.2580748863e+00;2.1773905536e+00;2.1950090035e+00;2.1441214013e+00;2.1595074854e+00;2.1547883840e+00;2.1592620182e+00;2.1594497556e+00;2.1438322583e+00;2.1363396508e+00;2.1259228242e+00;2.1611819848e+00;2.1343297099e+00;2.1310930150e+00;2.1237226551e+00;2.0987900547e+00;2.0924511182e+00;2.0764110643e+00;2.0937944006e+00;2.0430946342e+00;2.1128770459e+00;2.0988310668e+00;2.0548718573e+00;2.1473216777e+00;2.1174125587e+00;2.5155207226e+00;2.2877008154e+00;2.3115647814e+00;2.3205766796e+00;2.2709295076e+00;2.2755239851e+00;2.3178613063e+00;2.2193783768e+00;2.2817564969e+00;2.2801562370e+00;2.3071472915e+00;2.2754641757e+00;2.2703997068e+00;2.2864027712e+00;2.2653832718e+00;2.2498565696e+00;2.2251863116e+00;2.1888890282e+00;2.2163118923e+00;2.2540800655e+00;2.2653822747e+00;2.2693009185e+00;2.2328056230e+00;2.3000744107e+00;2.2882022194e+00;2.2382533665e+00;2.3034007218e+00;2.2525375362e+00;2.2954146378e+00;2.2789162849e+00;2.2703436682e+00;2.2028802700e+00;2.2447750248e+00;2.3545957631e+00;2.2384958536e+00;2.3325508006e+00;2.3008619347e+00;2.3863001092e+00;2.2581739478e+00;2.3202057804e+00;2.3090684725e+00;2.2364169520e+00;2.2796298306e+00;2.3110659269e+00;2.2590609320e+00;2.3232606615e+00;2.2584415812e+00;2.2866508672e+00;2.2766000223e+00;2.2454008714e+00;2.1597176205e+00;2.2897580909e+00;2.3211823405e+00;2.2091335163e+00;2.2843053408e+00;2.2571771565e+00;2.3324958013e+00;2.2472290769e+00;2.2707404522e+00;2.2168864547e+00;2.1716565078e+00;2.2590134748e+00;2.2129370724e+00;2.2362761677e+00;2.2444464049e+00;2.2196234633e+00;2.1831947719e+00;2.2193706787e+00;2.1470405712e+00;2.1872074374e+00;2.2606681576e+00;2.1642750257e+00;2.2703142783e+00;2.2055016368e+00;2.2711679878e+00;2.1718889738e+00;2.1936323217e+00;2.2307167866e+00;2.1774147970e+00;2.2761099197e+00;2.1855890494e+00;2.3393360903e+00;2.3540839037e+00;2.3766129592e+00;2.3776303459e+00;2.4572660110e+00;2.3829220321e+00;2.4281164347e+00;2.4824068116e+00;2.4967585749e+00 +noise_weight=1.0000000000e-03 +ped_weight=1.0000000000e-02 +pedestals=5.0355398374e+02;5.0355754425e+02;5.0032817033e+02;5.0243951998e+02;4.9941854706e+02;4.9795816268e+02;4.9754152820e+02;4.9811976064e+02;4.9713286303e+02;4.9590345816e+02;4.9750235459e+02;4.9738454231e+02;4.9782480720e+02;4.9701769957e+02;4.9666167427e+02;4.9990895783e+02;5.0031739717e+02;4.9377740950e+02;4.9280647150e+02;4.9502274166e+02;4.9353396384e+02;4.9385137850e+02;5.0074396684e+02;4.9811491269e+02;4.9532433658e+02;4.9796849379e+02;5.0040054929e+02;4.9705413739e+02;4.9759214358e+02;4.9973773740e+02;4.9844751567e+02;4.9935535196e+02;4.9679074588e+02;4.9734484679e+02;4.9771451765e+02;4.9884324598e+02;4.9970384313e+02;4.9995248652e+02;4.9315262874e+02;4.9119693467e+02;4.9577793669e+02;4.9443410255e+02;4.9735958705e+02;4.9784618161e+02;4.9864431094e+02;4.9704140014e+02;4.9111966250e+02;4.9590791757e+02;4.9730789733e+02;4.9780795897e+02;4.9722689298e+02;4.9582162333e+02;4.9292815382e+02;4.9373207719e+02;4.9180550736e+02;4.9541883553e+02;4.9892841700e+02;4.9837654641e+02;4.9829221219e+02;4.9927980720e+02;4.9678879744e+02;4.9041562221e+02;4.9665364288e+02;4.9938030627e+02;4.9626856256e+02;4.9640263368e+02;4.9569493023e+02;4.9630146856e+02;4.9703875619e+02;5.0157037418e+02;4.9793479990e+02;4.9641042349e+02;4.9846638815e+02;4.9942571904e+02;5.0054139671e+02;4.9682629718e+02;4.9772493219e+02;4.9899702034e+02;4.9830730123e+02;5.0096642761e+02;4.9930342579e+02;4.9784406361e+02;4.9969253013e+02;4.9513244566e+02;4.9914975978e+02;5.0142337484e+02;5.0210404874e+02;5.0255501997e+02;4.9699012847e+02;4.9678091832e+02;5.0196622809e+02;5.0017225410e+02;4.9662210857e+02;5.0196547744e+02;4.9897621259e+02;4.9620775794e+02;4.9209692531e+02;4.9905885274e+02;4.9248138240e+02;5.0036891268e+02;5.0059799615e+02;4.9825167346e+02;4.9459704239e+02;4.9562590750e+02;4.9816595672e+02;4.9881222872e+02;4.9759810758e+02;5.0223559772e+02;5.0271469623e+02;5.0178510965e+02;4.9384854702e+02;5.0078740962e+02;4.9695185802e+02;5.0043807101e+02;4.9957882252e+02;5.0144438688e+02;5.0119258813e+02;5.0816683898e+02;5.0645829290e+02;5.0767212022e+02;5.1207726898e+02;5.0802103923e+02;5.0957878015e+02;5.1570196490e+02;5.0892889781e+02;5.0670900600e+02;5.0584312216e+02;5.1292362390e+02;5.0813562062e+02;5.0864338860e+02;5.0784200448e+02;5.0501667382e+02;5.0696882864e+02;5.0989227617e+02;5.0468170725e+02;5.0601937979e+02;5.0603936521e+02;5.0652279702e+02;5.0221793527e+02;5.0245970428e+02;5.0343441573e+02;5.0323159384e+02;5.0346802496e+02;5.0555290015e+02;5.1083601202e+02;5.0507814125e+02;5.0917491703e+02;5.0660007785e+02;5.0683373056e+02;5.0826038561e+02;5.0744563605e+02;5.0500389862e+02;5.0969013531e+02;5.0575155765e+02;5.0948947872e+02;5.0530541186e+02;5.0110755466e+02;5.0331062117e+02;5.0650396812e+02;5.0583777387e+02;5.0133886575e+02;5.0560239667e+02;5.0317212624e+02;5.0227882152e+02;5.0216882791e+02;5.0424604553e+02;4.9794110852e+02;4.9763392151e+02;5.0207175155e+02;4.9913319495e+02;4.9771413224e+02;4.9602556354e+02;5.0038559402e+02;4.9713693327e+02;4.9800179035e+02;4.9711527574e+02;4.9971216390e+02;5.0104739252e+02;4.9762885508e+02;4.9718186032e+02;4.9983704711e+02;5.0018342187e+02;5.0928970398e+02;5.0171279938e+02;5.0271038955e+02;5.0359302306e+02;5.0405965696e+02;5.0019749570e+02;5.0483950858e+02;4.9701573545e+02;5.0013304461e+02;4.9859836190e+02;4.9764042775e+02;4.9900322044e+02;5.0411488991e+02;4.9946178422e+02;4.9872279760e+02;4.9965764091e+02;4.9735511712e+02;5.0061017040e+02;5.0116636864e+02;4.9938112359e+02;5.0279613342e+02;5.0487305378e+02;5.0150200987e+02;5.0149684770e+02;4.9865078104e+02;5.0421775840e+02;5.0269934129e+02;5.0484950273e+02;5.0005248836e+02;5.0860992477e+02;5.0651133496e+02;5.0686708944e+02;5.0429990137e+02;5.0547443044e+02;5.0681838345e+02;5.0519810985e+02;5.0587816685e+02;5.0992707894e+02;5.0675194906e+02;5.0429400867e+02;5.0909874525e+02;5.0763026604e+02;5.0967356660e+02;5.0341278452e+02;5.0896439271e+02;5.1261241496e+02;5.1151173879e+02;5.0846499307e+02;5.0903967925e+02;5.1222135362e+02;5.0827723365e+02;5.1308947859e+02;5.1392767027e+02;5.0659116667e+02;5.0606883260e+02;5.1842643234e+02;5.1017636629e+02;5.0994222680e+02;5.1403987637e+02;5.1409206919e+02;5.0866524903e+02;5.1187960598e+02;5.0592813273e+02;5.0739655389e+02;5.1499977651e+02;5.2038084186e+02;5.2014458934e+02;5.2060263499e+02;5.2014585504e+02;5.2119233017e+02;5.1688988636e+02;5.1818552311e+02;5.1604165069e+02;5.2100912740e+02 +polarity=0.0000000000e+00 +seed_cut=5.0000000000e+00 +sn_cut=5.0000000000e+00 + +[beetle] +CompCtrl=9 +Ibuf=10 +Icurrbuf=102 +Ipipe=13 +Ipre=76 +Isf=26 +Isha=10 +Itp=0 +Ivoltbuf=20 +Latency=128 +ROCtrl=26 +RclkDiv=0 +Vd=130 +Vdcl=105 +Vfp=0 +Vfs=0 +mask=3 + +[calibration] +charge=30720 +delay=85 +scan_charge=true + +[charge_scan] +from=0 +nevts=100 +npts=32 +to=32768 + +[comparator] +enable=false +mode=0 +polarity=0 + +[delay_scan] +from=0 +nevts=100 +npts=32 +to=256 + +[laser] +delay=62 + +[laser_sync] +from=30 +nevts=100 +npts=100 +to=130 + +[plugin] +active_on_load=false +hook= +lang= +lib= +path= + +[trigger] +dacA=-200 +dacB=-200 +dacC=-1000 +dacD=1000 +trigger_and=false +trigger_pulse=false + diff --git a/Software/AutomatedMeasurements/CCEDelayScanConfig/CCEDelayScanConfig63ns b/Software/AutomatedMeasurements/CCEDelayScanConfig/CCEDelayScanConfig63ns new file mode 100644 index 0000000..ddec354 --- /dev/null +++ b/Software/AutomatedMeasurements/CCEDelayScanConfig/CCEDelayScanConfig63ns @@ -0,0 +1,100 @@ +[Chip.0] +Icomp=5 +Ithdelta=5 +Ithmain=0 +Vrs=0 +mask=0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0 +trim=0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0 + +[Chip.1] +Icomp=5 +Ithdelta=5 +Ithmain=0 +Vrs=0 +mask=0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0 +trim=0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0 + +[DAQ] +delay=60 +enable_busy=false +monitor_channel=60 +nevts=10000000 +pulse_shape=false +sample_size=100 + +[analysis] +common_mode=true +neigh_cut=3.0000000000e+00 +noise=2.6843330855e+00;2.1273910742e+00;2.1946251615e+00;2.1792528015e+00;2.1346342653e+00;2.1304252071e+00;2.1487249342e+00;2.0736220208e+00;2.1174789609e+00;2.1198034078e+00;2.1245570630e+00;2.0585320753e+00;2.1158707879e+00;2.1035628675e+00;2.1147651929e+00;2.1183677238e+00;2.0299088119e+00;2.0714549926e+00;2.1464597704e+00;2.0827700463e+00;2.1103596971e+00;2.1527365459e+00;2.0422459056e+00;2.0550619460e+00;2.1458496486e+00;2.0129084057e+00;2.1129166776e+00;2.0748475125e+00;2.0199038746e+00;2.0192278668e+00;2.0089812223e+00;2.0455667312e+00;2.0199711846e+00;2.0644508452e+00;2.0334754732e+00;2.0264868749e+00;2.0679373437e+00;2.0575486813e+00;2.5246167453e+00;2.2849487840e+00;2.2444611935e+00;2.2618473659e+00;2.2822960523e+00;2.2300833669e+00;2.2270217638e+00;2.2602110154e+00;2.2587938434e+00;2.2785086163e+00;2.2340218049e+00;2.2102290887e+00;2.2414892074e+00;2.2287742588e+00;2.2539047171e+00;2.2935946178e+00;2.2757571087e+00;2.2933009647e+00;2.3066359472e+00;2.2178357716e+00;2.2774014449e+00;2.2331535822e+00;2.3097200912e+00;2.2968511656e+00;2.2460881810e+00;2.3032260897e+00;2.2426884896e+00;2.2743781671e+00;2.3089276152e+00;2.2302517447e+00;2.2502334945e+00;2.2082465105e+00;2.1827418263e+00;2.2702280811e+00;2.3041227089e+00;2.2281353014e+00;2.2805403204e+00;2.2439797345e+00;2.1939761911e+00;2.2656731875e+00;2.2440102332e+00;2.2189130484e+00;2.2024802646e+00;2.1796877507e+00;2.3316672524e+00;2.2375364421e+00;2.2224127116e+00;2.2778882187e+00;2.2235481125e+00;2.1747465694e+00;2.1475871833e+00;2.1865841942e+00;2.3106695732e+00;2.1564941968e+00;2.1540223079e+00;2.2060240104e+00;2.2314730122e+00;2.2285425174e+00;2.2001150809e+00;2.1897512930e+00;2.1812992133e+00;2.2280724603e+00;2.2238907887e+00;2.1746130603e+00;2.1259962129e+00;2.1996828807e+00;2.2179409498e+00;2.1751315309e+00;2.1931362069e+00;2.1966283799e+00;2.1504023509e+00;2.1641547419e+00;2.1633034580e+00;2.2235255539e+00;2.1572500811e+00;2.2297696204e+00;2.1241692106e+00;2.1678900738e+00;2.2585326443e+00;2.2400810497e+00;2.2470774439e+00;2.3776923690e+00;2.4333540473e+00;2.3767638731e+00;2.4335602253e+00;2.4452864976e+00;2.4316591635e+00;2.4519364652e+00;2.5289088517e+00;2.5027749471e+00;2.9552434446e+00;2.2236860157e+00;2.2107692233e+00;2.2181575627e+00;2.2706272121e+00;2.1724363563e+00;2.2082511487e+00;2.2194225733e+00;2.2116654230e+00;2.1716603662e+00;2.1296240316e+00;2.1814820640e+00;2.2293810426e+00;2.2580748863e+00;2.1773905536e+00;2.1950090035e+00;2.1441214013e+00;2.1595074854e+00;2.1547883840e+00;2.1592620182e+00;2.1594497556e+00;2.1438322583e+00;2.1363396508e+00;2.1259228242e+00;2.1611819848e+00;2.1343297099e+00;2.1310930150e+00;2.1237226551e+00;2.0987900547e+00;2.0924511182e+00;2.0764110643e+00;2.0937944006e+00;2.0430946342e+00;2.1128770459e+00;2.0988310668e+00;2.0548718573e+00;2.1473216777e+00;2.1174125587e+00;2.5155207226e+00;2.2877008154e+00;2.3115647814e+00;2.3205766796e+00;2.2709295076e+00;2.2755239851e+00;2.3178613063e+00;2.2193783768e+00;2.2817564969e+00;2.2801562370e+00;2.3071472915e+00;2.2754641757e+00;2.2703997068e+00;2.2864027712e+00;2.2653832718e+00;2.2498565696e+00;2.2251863116e+00;2.1888890282e+00;2.2163118923e+00;2.2540800655e+00;2.2653822747e+00;2.2693009185e+00;2.2328056230e+00;2.3000744107e+00;2.2882022194e+00;2.2382533665e+00;2.3034007218e+00;2.2525375362e+00;2.2954146378e+00;2.2789162849e+00;2.2703436682e+00;2.2028802700e+00;2.2447750248e+00;2.3545957631e+00;2.2384958536e+00;2.3325508006e+00;2.3008619347e+00;2.3863001092e+00;2.2581739478e+00;2.3202057804e+00;2.3090684725e+00;2.2364169520e+00;2.2796298306e+00;2.3110659269e+00;2.2590609320e+00;2.3232606615e+00;2.2584415812e+00;2.2866508672e+00;2.2766000223e+00;2.2454008714e+00;2.1597176205e+00;2.2897580909e+00;2.3211823405e+00;2.2091335163e+00;2.2843053408e+00;2.2571771565e+00;2.3324958013e+00;2.2472290769e+00;2.2707404522e+00;2.2168864547e+00;2.1716565078e+00;2.2590134748e+00;2.2129370724e+00;2.2362761677e+00;2.2444464049e+00;2.2196234633e+00;2.1831947719e+00;2.2193706787e+00;2.1470405712e+00;2.1872074374e+00;2.2606681576e+00;2.1642750257e+00;2.2703142783e+00;2.2055016368e+00;2.2711679878e+00;2.1718889738e+00;2.1936323217e+00;2.2307167866e+00;2.1774147970e+00;2.2761099197e+00;2.1855890494e+00;2.3393360903e+00;2.3540839037e+00;2.3766129592e+00;2.3776303459e+00;2.4572660110e+00;2.3829220321e+00;2.4281164347e+00;2.4824068116e+00;2.4967585749e+00 +noise_weight=1.0000000000e-03 +ped_weight=1.0000000000e-02 +pedestals=5.0355398374e+02;5.0355754425e+02;5.0032817033e+02;5.0243951998e+02;4.9941854706e+02;4.9795816268e+02;4.9754152820e+02;4.9811976064e+02;4.9713286303e+02;4.9590345816e+02;4.9750235459e+02;4.9738454231e+02;4.9782480720e+02;4.9701769957e+02;4.9666167427e+02;4.9990895783e+02;5.0031739717e+02;4.9377740950e+02;4.9280647150e+02;4.9502274166e+02;4.9353396384e+02;4.9385137850e+02;5.0074396684e+02;4.9811491269e+02;4.9532433658e+02;4.9796849379e+02;5.0040054929e+02;4.9705413739e+02;4.9759214358e+02;4.9973773740e+02;4.9844751567e+02;4.9935535196e+02;4.9679074588e+02;4.9734484679e+02;4.9771451765e+02;4.9884324598e+02;4.9970384313e+02;4.9995248652e+02;4.9315262874e+02;4.9119693467e+02;4.9577793669e+02;4.9443410255e+02;4.9735958705e+02;4.9784618161e+02;4.9864431094e+02;4.9704140014e+02;4.9111966250e+02;4.9590791757e+02;4.9730789733e+02;4.9780795897e+02;4.9722689298e+02;4.9582162333e+02;4.9292815382e+02;4.9373207719e+02;4.9180550736e+02;4.9541883553e+02;4.9892841700e+02;4.9837654641e+02;4.9829221219e+02;4.9927980720e+02;4.9678879744e+02;4.9041562221e+02;4.9665364288e+02;4.9938030627e+02;4.9626856256e+02;4.9640263368e+02;4.9569493023e+02;4.9630146856e+02;4.9703875619e+02;5.0157037418e+02;4.9793479990e+02;4.9641042349e+02;4.9846638815e+02;4.9942571904e+02;5.0054139671e+02;4.9682629718e+02;4.9772493219e+02;4.9899702034e+02;4.9830730123e+02;5.0096642761e+02;4.9930342579e+02;4.9784406361e+02;4.9969253013e+02;4.9513244566e+02;4.9914975978e+02;5.0142337484e+02;5.0210404874e+02;5.0255501997e+02;4.9699012847e+02;4.9678091832e+02;5.0196622809e+02;5.0017225410e+02;4.9662210857e+02;5.0196547744e+02;4.9897621259e+02;4.9620775794e+02;4.9209692531e+02;4.9905885274e+02;4.9248138240e+02;5.0036891268e+02;5.0059799615e+02;4.9825167346e+02;4.9459704239e+02;4.9562590750e+02;4.9816595672e+02;4.9881222872e+02;4.9759810758e+02;5.0223559772e+02;5.0271469623e+02;5.0178510965e+02;4.9384854702e+02;5.0078740962e+02;4.9695185802e+02;5.0043807101e+02;4.9957882252e+02;5.0144438688e+02;5.0119258813e+02;5.0816683898e+02;5.0645829290e+02;5.0767212022e+02;5.1207726898e+02;5.0802103923e+02;5.0957878015e+02;5.1570196490e+02;5.0892889781e+02;5.0670900600e+02;5.0584312216e+02;5.1292362390e+02;5.0813562062e+02;5.0864338860e+02;5.0784200448e+02;5.0501667382e+02;5.0696882864e+02;5.0989227617e+02;5.0468170725e+02;5.0601937979e+02;5.0603936521e+02;5.0652279702e+02;5.0221793527e+02;5.0245970428e+02;5.0343441573e+02;5.0323159384e+02;5.0346802496e+02;5.0555290015e+02;5.1083601202e+02;5.0507814125e+02;5.0917491703e+02;5.0660007785e+02;5.0683373056e+02;5.0826038561e+02;5.0744563605e+02;5.0500389862e+02;5.0969013531e+02;5.0575155765e+02;5.0948947872e+02;5.0530541186e+02;5.0110755466e+02;5.0331062117e+02;5.0650396812e+02;5.0583777387e+02;5.0133886575e+02;5.0560239667e+02;5.0317212624e+02;5.0227882152e+02;5.0216882791e+02;5.0424604553e+02;4.9794110852e+02;4.9763392151e+02;5.0207175155e+02;4.9913319495e+02;4.9771413224e+02;4.9602556354e+02;5.0038559402e+02;4.9713693327e+02;4.9800179035e+02;4.9711527574e+02;4.9971216390e+02;5.0104739252e+02;4.9762885508e+02;4.9718186032e+02;4.9983704711e+02;5.0018342187e+02;5.0928970398e+02;5.0171279938e+02;5.0271038955e+02;5.0359302306e+02;5.0405965696e+02;5.0019749570e+02;5.0483950858e+02;4.9701573545e+02;5.0013304461e+02;4.9859836190e+02;4.9764042775e+02;4.9900322044e+02;5.0411488991e+02;4.9946178422e+02;4.9872279760e+02;4.9965764091e+02;4.9735511712e+02;5.0061017040e+02;5.0116636864e+02;4.9938112359e+02;5.0279613342e+02;5.0487305378e+02;5.0150200987e+02;5.0149684770e+02;4.9865078104e+02;5.0421775840e+02;5.0269934129e+02;5.0484950273e+02;5.0005248836e+02;5.0860992477e+02;5.0651133496e+02;5.0686708944e+02;5.0429990137e+02;5.0547443044e+02;5.0681838345e+02;5.0519810985e+02;5.0587816685e+02;5.0992707894e+02;5.0675194906e+02;5.0429400867e+02;5.0909874525e+02;5.0763026604e+02;5.0967356660e+02;5.0341278452e+02;5.0896439271e+02;5.1261241496e+02;5.1151173879e+02;5.0846499307e+02;5.0903967925e+02;5.1222135362e+02;5.0827723365e+02;5.1308947859e+02;5.1392767027e+02;5.0659116667e+02;5.0606883260e+02;5.1842643234e+02;5.1017636629e+02;5.0994222680e+02;5.1403987637e+02;5.1409206919e+02;5.0866524903e+02;5.1187960598e+02;5.0592813273e+02;5.0739655389e+02;5.1499977651e+02;5.2038084186e+02;5.2014458934e+02;5.2060263499e+02;5.2014585504e+02;5.2119233017e+02;5.1688988636e+02;5.1818552311e+02;5.1604165069e+02;5.2100912740e+02 +polarity=0.0000000000e+00 +seed_cut=5.0000000000e+00 +sn_cut=5.0000000000e+00 + +[beetle] +CompCtrl=9 +Ibuf=10 +Icurrbuf=102 +Ipipe=13 +Ipre=76 +Isf=26 +Isha=10 +Itp=0 +Ivoltbuf=20 +Latency=128 +ROCtrl=26 +RclkDiv=0 +Vd=130 +Vdcl=105 +Vfp=0 +Vfs=0 +mask=3 + +[calibration] +charge=30720 +delay=85 +scan_charge=true + +[charge_scan] +from=0 +nevts=100 +npts=32 +to=32768 + +[comparator] +enable=false +mode=0 +polarity=0 + +[delay_scan] +from=0 +nevts=100 +npts=32 +to=256 + +[laser] +delay=63 + +[laser_sync] +from=30 +nevts=100 +npts=100 +to=130 + +[plugin] +active_on_load=false +hook= +lang= +lib= +path= + +[trigger] +dacA=-200 +dacB=-200 +dacC=-1000 +dacD=1000 +trigger_and=false +trigger_pulse=false + diff --git a/Software/AutomatedMeasurements/CCEDelayScanConfig/CCEDelayScanConfig64ns b/Software/AutomatedMeasurements/CCEDelayScanConfig/CCEDelayScanConfig64ns new file mode 100644 index 0000000..16e715f --- /dev/null +++ b/Software/AutomatedMeasurements/CCEDelayScanConfig/CCEDelayScanConfig64ns @@ -0,0 +1,100 @@ +[Chip.0] +Icomp=5 +Ithdelta=5 +Ithmain=0 +Vrs=0 +mask=0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0 +trim=0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0 + +[Chip.1] +Icomp=5 +Ithdelta=5 +Ithmain=0 +Vrs=0 +mask=0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0 +trim=0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0 + +[DAQ] +delay=60 +enable_busy=false +monitor_channel=60 +nevts=10000000 +pulse_shape=false +sample_size=100 + +[analysis] +common_mode=true +neigh_cut=3.0000000000e+00 +noise=2.6843330855e+00;2.1273910742e+00;2.1946251615e+00;2.1792528015e+00;2.1346342653e+00;2.1304252071e+00;2.1487249342e+00;2.0736220208e+00;2.1174789609e+00;2.1198034078e+00;2.1245570630e+00;2.0585320753e+00;2.1158707879e+00;2.1035628675e+00;2.1147651929e+00;2.1183677238e+00;2.0299088119e+00;2.0714549926e+00;2.1464597704e+00;2.0827700463e+00;2.1103596971e+00;2.1527365459e+00;2.0422459056e+00;2.0550619460e+00;2.1458496486e+00;2.0129084057e+00;2.1129166776e+00;2.0748475125e+00;2.0199038746e+00;2.0192278668e+00;2.0089812223e+00;2.0455667312e+00;2.0199711846e+00;2.0644508452e+00;2.0334754732e+00;2.0264868749e+00;2.0679373437e+00;2.0575486813e+00;2.5246167453e+00;2.2849487840e+00;2.2444611935e+00;2.2618473659e+00;2.2822960523e+00;2.2300833669e+00;2.2270217638e+00;2.2602110154e+00;2.2587938434e+00;2.2785086163e+00;2.2340218049e+00;2.2102290887e+00;2.2414892074e+00;2.2287742588e+00;2.2539047171e+00;2.2935946178e+00;2.2757571087e+00;2.2933009647e+00;2.3066359472e+00;2.2178357716e+00;2.2774014449e+00;2.2331535822e+00;2.3097200912e+00;2.2968511656e+00;2.2460881810e+00;2.3032260897e+00;2.2426884896e+00;2.2743781671e+00;2.3089276152e+00;2.2302517447e+00;2.2502334945e+00;2.2082465105e+00;2.1827418263e+00;2.2702280811e+00;2.3041227089e+00;2.2281353014e+00;2.2805403204e+00;2.2439797345e+00;2.1939761911e+00;2.2656731875e+00;2.2440102332e+00;2.2189130484e+00;2.2024802646e+00;2.1796877507e+00;2.3316672524e+00;2.2375364421e+00;2.2224127116e+00;2.2778882187e+00;2.2235481125e+00;2.1747465694e+00;2.1475871833e+00;2.1865841942e+00;2.3106695732e+00;2.1564941968e+00;2.1540223079e+00;2.2060240104e+00;2.2314730122e+00;2.2285425174e+00;2.2001150809e+00;2.1897512930e+00;2.1812992133e+00;2.2280724603e+00;2.2238907887e+00;2.1746130603e+00;2.1259962129e+00;2.1996828807e+00;2.2179409498e+00;2.1751315309e+00;2.1931362069e+00;2.1966283799e+00;2.1504023509e+00;2.1641547419e+00;2.1633034580e+00;2.2235255539e+00;2.1572500811e+00;2.2297696204e+00;2.1241692106e+00;2.1678900738e+00;2.2585326443e+00;2.2400810497e+00;2.2470774439e+00;2.3776923690e+00;2.4333540473e+00;2.3767638731e+00;2.4335602253e+00;2.4452864976e+00;2.4316591635e+00;2.4519364652e+00;2.5289088517e+00;2.5027749471e+00;2.9552434446e+00;2.2236860157e+00;2.2107692233e+00;2.2181575627e+00;2.2706272121e+00;2.1724363563e+00;2.2082511487e+00;2.2194225733e+00;2.2116654230e+00;2.1716603662e+00;2.1296240316e+00;2.1814820640e+00;2.2293810426e+00;2.2580748863e+00;2.1773905536e+00;2.1950090035e+00;2.1441214013e+00;2.1595074854e+00;2.1547883840e+00;2.1592620182e+00;2.1594497556e+00;2.1438322583e+00;2.1363396508e+00;2.1259228242e+00;2.1611819848e+00;2.1343297099e+00;2.1310930150e+00;2.1237226551e+00;2.0987900547e+00;2.0924511182e+00;2.0764110643e+00;2.0937944006e+00;2.0430946342e+00;2.1128770459e+00;2.0988310668e+00;2.0548718573e+00;2.1473216777e+00;2.1174125587e+00;2.5155207226e+00;2.2877008154e+00;2.3115647814e+00;2.3205766796e+00;2.2709295076e+00;2.2755239851e+00;2.3178613063e+00;2.2193783768e+00;2.2817564969e+00;2.2801562370e+00;2.3071472915e+00;2.2754641757e+00;2.2703997068e+00;2.2864027712e+00;2.2653832718e+00;2.2498565696e+00;2.2251863116e+00;2.1888890282e+00;2.2163118923e+00;2.2540800655e+00;2.2653822747e+00;2.2693009185e+00;2.2328056230e+00;2.3000744107e+00;2.2882022194e+00;2.2382533665e+00;2.3034007218e+00;2.2525375362e+00;2.2954146378e+00;2.2789162849e+00;2.2703436682e+00;2.2028802700e+00;2.2447750248e+00;2.3545957631e+00;2.2384958536e+00;2.3325508006e+00;2.3008619347e+00;2.3863001092e+00;2.2581739478e+00;2.3202057804e+00;2.3090684725e+00;2.2364169520e+00;2.2796298306e+00;2.3110659269e+00;2.2590609320e+00;2.3232606615e+00;2.2584415812e+00;2.2866508672e+00;2.2766000223e+00;2.2454008714e+00;2.1597176205e+00;2.2897580909e+00;2.3211823405e+00;2.2091335163e+00;2.2843053408e+00;2.2571771565e+00;2.3324958013e+00;2.2472290769e+00;2.2707404522e+00;2.2168864547e+00;2.1716565078e+00;2.2590134748e+00;2.2129370724e+00;2.2362761677e+00;2.2444464049e+00;2.2196234633e+00;2.1831947719e+00;2.2193706787e+00;2.1470405712e+00;2.1872074374e+00;2.2606681576e+00;2.1642750257e+00;2.2703142783e+00;2.2055016368e+00;2.2711679878e+00;2.1718889738e+00;2.1936323217e+00;2.2307167866e+00;2.1774147970e+00;2.2761099197e+00;2.1855890494e+00;2.3393360903e+00;2.3540839037e+00;2.3766129592e+00;2.3776303459e+00;2.4572660110e+00;2.3829220321e+00;2.4281164347e+00;2.4824068116e+00;2.4967585749e+00 +noise_weight=1.0000000000e-03 +ped_weight=1.0000000000e-02 +pedestals=5.0355398374e+02;5.0355754425e+02;5.0032817033e+02;5.0243951998e+02;4.9941854706e+02;4.9795816268e+02;4.9754152820e+02;4.9811976064e+02;4.9713286303e+02;4.9590345816e+02;4.9750235459e+02;4.9738454231e+02;4.9782480720e+02;4.9701769957e+02;4.9666167427e+02;4.9990895783e+02;5.0031739717e+02;4.9377740950e+02;4.9280647150e+02;4.9502274166e+02;4.9353396384e+02;4.9385137850e+02;5.0074396684e+02;4.9811491269e+02;4.9532433658e+02;4.9796849379e+02;5.0040054929e+02;4.9705413739e+02;4.9759214358e+02;4.9973773740e+02;4.9844751567e+02;4.9935535196e+02;4.9679074588e+02;4.9734484679e+02;4.9771451765e+02;4.9884324598e+02;4.9970384313e+02;4.9995248652e+02;4.9315262874e+02;4.9119693467e+02;4.9577793669e+02;4.9443410255e+02;4.9735958705e+02;4.9784618161e+02;4.9864431094e+02;4.9704140014e+02;4.9111966250e+02;4.9590791757e+02;4.9730789733e+02;4.9780795897e+02;4.9722689298e+02;4.9582162333e+02;4.9292815382e+02;4.9373207719e+02;4.9180550736e+02;4.9541883553e+02;4.9892841700e+02;4.9837654641e+02;4.9829221219e+02;4.9927980720e+02;4.9678879744e+02;4.9041562221e+02;4.9665364288e+02;4.9938030627e+02;4.9626856256e+02;4.9640263368e+02;4.9569493023e+02;4.9630146856e+02;4.9703875619e+02;5.0157037418e+02;4.9793479990e+02;4.9641042349e+02;4.9846638815e+02;4.9942571904e+02;5.0054139671e+02;4.9682629718e+02;4.9772493219e+02;4.9899702034e+02;4.9830730123e+02;5.0096642761e+02;4.9930342579e+02;4.9784406361e+02;4.9969253013e+02;4.9513244566e+02;4.9914975978e+02;5.0142337484e+02;5.0210404874e+02;5.0255501997e+02;4.9699012847e+02;4.9678091832e+02;5.0196622809e+02;5.0017225410e+02;4.9662210857e+02;5.0196547744e+02;4.9897621259e+02;4.9620775794e+02;4.9209692531e+02;4.9905885274e+02;4.9248138240e+02;5.0036891268e+02;5.0059799615e+02;4.9825167346e+02;4.9459704239e+02;4.9562590750e+02;4.9816595672e+02;4.9881222872e+02;4.9759810758e+02;5.0223559772e+02;5.0271469623e+02;5.0178510965e+02;4.9384854702e+02;5.0078740962e+02;4.9695185802e+02;5.0043807101e+02;4.9957882252e+02;5.0144438688e+02;5.0119258813e+02;5.0816683898e+02;5.0645829290e+02;5.0767212022e+02;5.1207726898e+02;5.0802103923e+02;5.0957878015e+02;5.1570196490e+02;5.0892889781e+02;5.0670900600e+02;5.0584312216e+02;5.1292362390e+02;5.0813562062e+02;5.0864338860e+02;5.0784200448e+02;5.0501667382e+02;5.0696882864e+02;5.0989227617e+02;5.0468170725e+02;5.0601937979e+02;5.0603936521e+02;5.0652279702e+02;5.0221793527e+02;5.0245970428e+02;5.0343441573e+02;5.0323159384e+02;5.0346802496e+02;5.0555290015e+02;5.1083601202e+02;5.0507814125e+02;5.0917491703e+02;5.0660007785e+02;5.0683373056e+02;5.0826038561e+02;5.0744563605e+02;5.0500389862e+02;5.0969013531e+02;5.0575155765e+02;5.0948947872e+02;5.0530541186e+02;5.0110755466e+02;5.0331062117e+02;5.0650396812e+02;5.0583777387e+02;5.0133886575e+02;5.0560239667e+02;5.0317212624e+02;5.0227882152e+02;5.0216882791e+02;5.0424604553e+02;4.9794110852e+02;4.9763392151e+02;5.0207175155e+02;4.9913319495e+02;4.9771413224e+02;4.9602556354e+02;5.0038559402e+02;4.9713693327e+02;4.9800179035e+02;4.9711527574e+02;4.9971216390e+02;5.0104739252e+02;4.9762885508e+02;4.9718186032e+02;4.9983704711e+02;5.0018342187e+02;5.0928970398e+02;5.0171279938e+02;5.0271038955e+02;5.0359302306e+02;5.0405965696e+02;5.0019749570e+02;5.0483950858e+02;4.9701573545e+02;5.0013304461e+02;4.9859836190e+02;4.9764042775e+02;4.9900322044e+02;5.0411488991e+02;4.9946178422e+02;4.9872279760e+02;4.9965764091e+02;4.9735511712e+02;5.0061017040e+02;5.0116636864e+02;4.9938112359e+02;5.0279613342e+02;5.0487305378e+02;5.0150200987e+02;5.0149684770e+02;4.9865078104e+02;5.0421775840e+02;5.0269934129e+02;5.0484950273e+02;5.0005248836e+02;5.0860992477e+02;5.0651133496e+02;5.0686708944e+02;5.0429990137e+02;5.0547443044e+02;5.0681838345e+02;5.0519810985e+02;5.0587816685e+02;5.0992707894e+02;5.0675194906e+02;5.0429400867e+02;5.0909874525e+02;5.0763026604e+02;5.0967356660e+02;5.0341278452e+02;5.0896439271e+02;5.1261241496e+02;5.1151173879e+02;5.0846499307e+02;5.0903967925e+02;5.1222135362e+02;5.0827723365e+02;5.1308947859e+02;5.1392767027e+02;5.0659116667e+02;5.0606883260e+02;5.1842643234e+02;5.1017636629e+02;5.0994222680e+02;5.1403987637e+02;5.1409206919e+02;5.0866524903e+02;5.1187960598e+02;5.0592813273e+02;5.0739655389e+02;5.1499977651e+02;5.2038084186e+02;5.2014458934e+02;5.2060263499e+02;5.2014585504e+02;5.2119233017e+02;5.1688988636e+02;5.1818552311e+02;5.1604165069e+02;5.2100912740e+02 +polarity=0.0000000000e+00 +seed_cut=5.0000000000e+00 +sn_cut=5.0000000000e+00 + +[beetle] +CompCtrl=9 +Ibuf=10 +Icurrbuf=102 +Ipipe=13 +Ipre=76 +Isf=26 +Isha=10 +Itp=0 +Ivoltbuf=20 +Latency=128 +ROCtrl=26 +RclkDiv=0 +Vd=130 +Vdcl=105 +Vfp=0 +Vfs=0 +mask=3 + +[calibration] +charge=30720 +delay=85 +scan_charge=true + +[charge_scan] +from=0 +nevts=100 +npts=32 +to=32768 + +[comparator] +enable=false +mode=0 +polarity=0 + +[delay_scan] +from=0 +nevts=100 +npts=32 +to=256 + +[laser] +delay=64 + +[laser_sync] +from=30 +nevts=100 +npts=100 +to=130 + +[plugin] +active_on_load=false +hook= +lang= +lib= +path= + +[trigger] +dacA=-200 +dacB=-200 +dacC=-1000 +dacD=1000 +trigger_and=false +trigger_pulse=false + diff --git a/Software/AutomatedMeasurements/ElectronicMonkeyMovement.py b/Software/AutomatedMeasurements/ElectronicMonkeyMovement.py new file mode 100644 index 0000000..c2bf93a --- /dev/null +++ b/Software/AutomatedMeasurements/ElectronicMonkeyMovement.py @@ -0,0 +1,132 @@ +''' + +Author: Federica Lionetto +Date: July 27th, 2015 + +Description: +It moves the laser to the desired position along x and z. +After each movement, a new entry is written into a text file, to keep track of the command that has been sent and of the new absolute position of the laser. + +Parameters: +- , the type of sensor; +- , the desired x position; +- , the desired z position. + +How to run it: +python ElectronicMonkeyMovement.py --s --x --z + +For example: +python ElectronicMonkeyMovement.py --s ATLAS --x 0 -z 0 + +Arduino device ID: +DEVICE ID 2341:0042 on Bus 001 Address 045, Communications Device (in hexadecimal) + +To get some information on the device: +lsusb -v -d 2341:0042 + +''' + +import argparse +import subprocess +import os + +import serial + +import time + +import sys +sys.path.insert(0,'../Tools') +from SendEmail import * + +import numpy as np + +parser = argparse.ArgumentParser(description='Define the parameters of the automated movement of the laser.') + +parser.add_argument('--s',help='type of sensor',required=True) +parser.add_argument('--x',type=int,help='desired x position',required=True) +parser.add_argument('--z',type=int,help='desired z position',required=True) + +args = parser.parse_args() + +# Parameters and configuration. +sensor = args.s +desiredx = args.x +desiredz = args.z + +print 'Type of sensor: ', sensor +print 'Desired x position: %i steps' % desiredx +print 'Desired z position: %i steps' % desiredz + +# Find Arduino. +ser = serial.Serial('/dev/ttyACM0',9600) + +folder = '/disk/groups/hep/flionett/TestStand/Data' +filename = folder+'/'+sensor+'/'+'MovementHistory.dat' +# Create the folder if it does not already exist. +if not os.path.exists(folder+"/"+sensor): + os.makedirs(folder+"/"+sensor) +# Header to be written in the output text file. +header = 'Date&Time Absolute x (steps) Absolute z (steps) Command for x (steps) Command for z (steps)\n' + +# Move the laser to the desired position along x and z. +print 'Move the laser to the desired position along x and z.' +# +10 if desiredx is positive, +20 if desiredx is negative, desiredx times. +for xcounter in range(abs(desiredx)) : + print 'Step along x %i of %i' % (xcounter,desiredx) + if (desiredx > 0) : + ser.write('+10') + elif (desiredx < 0) : + ser.write('+20') + time.sleep(1) +# +01 if desiredz is positive, +02 if desiredz is negative, desiredz times. +for zcounter in range(abs(desiredz)) : + print 'Step along z %i of %i' % (zcounter,desiredz) + if (desiredz > 0) : + ser.write('+01') + elif (desiredz < 0) : + ser.write('+02') + time.sleep(1) + +print "================================================================================================" +print "Writing into output text file: " +print filename +print "================================================================================================" + +file = open(filename,"a") +# Write the header only if the file is empty. +filesize = os.path.getsize(filename) +if (filesize == 0) : + file.write(header) + oldx = 0 + oldz = 0 +else : + ax, az = np.loadtxt(filename,delimiter=' ',skiprows=1,usecols=(5,6),unpack=True) + print ax + print az + if (ax.size == 1) : + oldx = ax + oldz = az + else : + oldx = ax[-1] + oldz = az[-1] + +currentTime = time.ctime() +newx = oldx+desiredx +newz = oldz+desiredz +# header = 'Date&Time Absolute x (steps) Absolute z (steps) Command for x (steps) Command for z (steps)\n' +row = currentTime + " " + "%i" % newx + " " + "%i" % newz + " " + "%i" % desiredx + " " + "%i" % desiredz + "\n" +print row +file.write(row) + +# Close output text file. +file.close() + +print 'Laser successfully positioned!' + +# Send email. +sender = 'federica.lionetto@cern.ch' +receiver = 'federica.lionetto@cern.ch' +# receiver = 'philipp.gloor@gmail.com' +message = 'End of the automated movement of the laser! Go to switch off the stepper motors ;)' +subject = 'End of the automated movement of the laser!' +send_email(sender,receiver,message,subject) diff --git a/Software/BiasVoltageScan/BiasVoltageScan.C b/Software/BiasVoltageScan/BiasVoltageScan.C index b99247b..e1932f1 100644 --- a/Software/BiasVoltageScan/BiasVoltageScan.C +++ b/Software/BiasVoltageScan/BiasVoltageScan.C @@ -4,14 +4,14 @@ //************************************************ /* -BiasVoltageScan reads all the ROOT files of a given bias voltage scan data taking, calls FindStrip to find the Beetle channel corresponding to the strip hit by the laser, and creates a ROOT file with the following information: -- a graph with the mean ADC count on the strip hit by the laser as a function of the bias voltage; -- a graph with the mean of the sum of the ADC counts of four adjacent strips around that hit by the laser as a function of the bias voltage. + BiasVoltageScan reads all the ROOT files of a given bias voltage scan data taking, calls FindStrip to find the Beetle channel corresponding to the strip hit by the laser, and creates a ROOT file with the following information: + - a graph with the mean ADC count on the strip hit by the laser as a function of the bias voltage; + - a graph with the mean of the sum of the ADC counts of four adjacent strips around that hit by the laser as a function of the bias voltage. -The bias voltage scan data taking is identified by the following information: -- , that is, the type of sensor (Hans410, ...); -- , that is, the filename excluding the bias voltage value and the run type. -*/ + The bias voltage scan data taking is identified by the following information: + - , that is, the type of sensor (Hans410, ...); + - , that is, the filename excluding the ProcessRawData- or ComputeCMN- strings, as well as the bias voltage value and the run type. + */ #include "../Tools/Lib.C" #include "../Tools/lhcbStyle.C" @@ -20,200 +20,252 @@ #include "../Tools/FindStrip.C" #include "../Tools/Par.C" -void BiasVoltageScan(char *sensor, char *filename, char *externalPath = 0); +void BiasVoltageScan(char *sensorID, char *filename, Int_t CMNSub, char *externalPath = 0); int main(int argc, char *argv[]) { - getLHCbStyle(); - PersonalStyle(); + getLHCbStyle(); + PersonalStyle(); - if ((argc == 2) && (string(argv[1]) == "--info")) - { - cout << "**************************************************" << endl; + if ((argc == 2) && (string(argv[1]) == "--info")) + { + cout << "**************************************************" << endl; - cout << "Some comments." << endl; - - cout << "**************************************************" << endl; + cout << "Some comments." << endl; - return 0; - } - else if (argc < 3) - { - cout << "**************************************************" << endl; + cout << "**************************************************" << endl; - cout << "Error! Type of sensor or filename missing..." << endl; - cout << "Please use the following format:" << endl; - cout << "./BiasVoltageScan [1] [2] [3]" << endl; - cout << "with:" << endl; - cout << "[1] = Type of sensor (Hans410, ...);" << endl; - cout << "[2] = Filename, excluding the bias voltage value and the run type;" << endl; - cout << "[3] = Additional folder, optional." << endl; - cout << "Type ./BiasVoltageScan --info for more information." << endl; - - cout << "**************************************************" << endl; + return 0; + } + else if (argc < 4) + { + cout << "**************************************************" << endl; - return 0; - } - else - { - cout << "Type of sensor: " << argv[1] << endl; - cout << "Filename: " << argv[2] << endl; - if (argc == 3) - BiasVoltageScan(argv[1],argv[2]); - else if (argc == 4) - BiasVoltageScan(argv[1],argv[2],argv[3]); + cout << "Error! Type of sensor or filename missing..." << endl; + cout << "Please use the following format:" << endl; + cout << "./BiasVoltageScan [1] [2] [3] [4]" << endl; + cout << "with:" << endl; + cout << "[1] = Type of sensor (Hans410, ...);" << endl; + cout << "[2] = Filename, excluding the bias voltage value and the run type;" << endl; + cout << "[3] = Status of the CMN subtraction (kTrue or kFalse);" << endl; + cout << "[4] = Additional folder, optional." << endl; + cout << "Type ./BiasVoltageScan --info for more information." << endl; + + cout << "**************************************************" << endl; + + return 0; + } else { - cout << "Error! Too many arguments given..." << endl; - - return 0; + cout << "Type of sensor: " << argv[1] << endl; + cout << "Filename: " << argv[2] << endl; + cout << "Status of the CMN subtraction: " << argv[3] << endl; + if (argc == 4) + BiasVoltageScan(argv[1],argv[2],atoi(argv[3])); + else if (argc == 5) + BiasVoltageScan(argv[1],argv[2],atoi(argv[3]),argv[4]); + else + { + cout << "Error! Too many arguments given..." << endl; + + return 0; + } + + return 0; } - - return 0; - } } -void BiasVoltageScan(char *sensor, char *filename, char *externalPath) +void BiasVoltageScan(char *sensorID, char *filename, Int_t CMNSub, char *externalPath) { - cout << "**************************************************" << endl; - cout << "Performing bias voltage scan..." << endl; - cout << "**************************************************" << endl; + cout << "**************************************************" << endl; + cout << "Performing bias voltage scan..." << endl; + cout << "**************************************************" << endl; - // Do not comment this line. - gROOT->ProcessLine("#include "); - - // Do some fanciness to get the directory right. - string inputDirectory = "/disk/groups/hep/flionett/TestStand/AnalysisResults/"+string(sensor)+"/BiasVoltageScan"; - string outputDirectory = "/disk/groups/hep/flionett/TestStand/AnalysisResults/"+string(sensor)+"/BiasVoltageScan"; - if (externalPath!=0) - outputDirectory = string(outputDirectory+"/"+externalPath); - cout << "The input directory is: " << inputDirectory << endl; - cout << "The output directory is: " << outputDirectory << endl; - - // Create the outputDirectory directory if it does not exist. - string path_to_make = "mkdir -p "+outputDirectory; - system(path_to_make.c_str()); - - cout << "Figures stored in: " << outputDirectory+"/Figures/"+filename << endl; - - // Create a directory named Figures inside the directory named outputDirectory if it does not exist. - string path_to_make_figures = "mkdir -p "+outputDirectory+"/Figures/"+filename; - system(path_to_make_figures.c_str()); - - TString path_to_figures = (string(path_to_make_figures)).substr((string(path_to_make_figures)).find_last_of(' ')+1); - - // Execute findStrip. - int strip; - string direction; - - string inputFindStrip; - if ((sensorID == "Hans410") || (sensorID == "Hans320")) - inputFindStrip = inputDirectory+"/"+filename+"-150V-las.root"; - else if (sensorID == "ATLAS") - inputFindStrip = inputDirectory+"/"+filename+"--150V-las.root"; - - string outputFindStrip; - if ((sensorID == "Hans410") || (sensorID == "Hans320")) - outputFindStrip = outputDirectory+"/FindStrip-"+filename+"-150V-las.root"; - else if (sensorID == "ATLAS") - outputFindStrip = outputDirectory+"/FindStrip-"+filename+"--150V-las.root"; - - FindStrip(inputFindStrip,outputFindStrip,path_to_figures,&strip,&direction); - - char char_input_ROOT[200]; - string input_ROOT; - string output_ROOT = outputDirectory+"/BiasVoltageScan-"+filename+".root"; - - Float_t minV = 0.; - Float_t maxV = 0.; - if ((sensorID == "Hans410") || (sensorID == "Hans320")) - { - minV = 30.; - maxV = 350.; - } - else if (sensorID == "ATLAS") - { - minV = -350; - maxV = -30; - } - const Float_t stepV = 10.; - const Int_t steps = (Int_t)((maxV-minV)/stepV+1); - Float_t V[steps]; - Float_t meanADC[steps]; - Float_t mean4ADC[steps]; - - // Open output ROOT file. - TFile *output = TFile::Open(TString(output_ROOT),"RECREATE"); - - for (Int_t step=0;stepProcessLine("#include "); + + // Do some fanciness to get the directory right. + string inputDirectory = "/disk/groups/hep/flionett/TestStand/AnalysisResults/"+string(sensorID)+"/BiasVoltageScan"; + string outputDirectory = "/disk/groups/hep/flionett/TestStand/AnalysisResults/"+string(sensorID)+"/BiasVoltageScan"; + if (externalPath!=0) + outputDirectory = string(outputDirectory+"/"+externalPath); + cout << "The input directory is: " << inputDirectory << endl; + cout << "The output directory is: " << outputDirectory << endl; + + // Create the outputDirectory directory if it does not exist. + string path_to_make = "mkdir -p "+outputDirectory; + system(path_to_make.c_str()); + + cout << "Figures stored in: " << outputDirectory+"/Figures/"+filename << endl; + + // Create a directory named Figures inside the directory named outputDirectory if it does not exist. + string path_to_make_figures = "mkdir -p "+outputDirectory+"/Figures/"+filename; + system(path_to_make_figures.c_str()); + + TString path_to_figures = (string(path_to_make_figures)).substr((string(path_to_make_figures)).find_last_of(' ')+1); + + // Execute findStrip. + int strip; + string direction; + + string inputFindStrip; + if ((sensor == "Hans410") || (sensor == "Hans320")) + inputFindStrip = inputDirectory+"/ProcessRawData-"+filename+"-150V-las.root"; + else if (sensor == "ATLAS") + inputFindStrip = inputDirectory+"/ProcessRawData-"+filename+"--150V-las.root"; + + string outputFindStrip; + if ((sensor == "Hans410") || (sensor == "Hans320")) + outputFindStrip = outputDirectory+"/FindStrip-"+filename+"-150V-las.root"; + else if (sensor == "ATLAS") + outputFindStrip = outputDirectory+"/FindStrip-"+filename+"--150V-las.root"; + + FindStrip(inputFindStrip,outputFindStrip,path_to_figures,&strip,&direction); + + char char_input_ROOT[200]; + string input_ROOT; + string output_ROOT; + if (CMNSub == 1) + output_ROOT = outputDirectory+"/BiasVoltageScan-ComputeCMN-"+filename+".root"; + else + output_ROOT = outputDirectory+"/BiasVoltageScan-"+filename+".root"; + + Float_t minV = 0.; + Float_t maxV = 0.; + if ((sensor == "Hans410") || (sensor == "Hans320")) + { + minV = 30.; + maxV = 350.; + } + else if (sensor == "ATLAS") + { + minV = -350; + maxV = -30; + } + const Float_t stepV = 10.; + const Int_t steps = (Int_t)((maxV-minV)/stepV+1); + Float_t V[steps]; + Float_t meanADC[steps]; + Float_t mean4ADC[steps]; + + // Open output ROOT file. + TFile *output = TFile::Open(TString(output_ROOT),"RECREATE"); + + for (Int_t step=0;stepGet(Form("CMNSubStraightLine/hADCPedCMNSub%d",strip)); + cout << "Histograms: " << endl; + cout << Form("CMNSubStraightLine/hADCPedCMNSub%d",strip) << endl; + cout << Form("CMNSubStraightLine/hADCPedCMNSub%d",strip+NSkip) << endl; + cout << Form("CMNSubStraightLine/hADCPedCMNSub%d",strip-NSkip) << endl; + cout << Form("CMNSubStraightLine/hADCPedCMNSub%d",strip-2*NSkip) << endl; + cout << Form("CMNSubStraightLine/hADCPedCMNSub%d",strip+2*NSkip) << endl; + + // Four adjacent strips. + hist1 = (TH1F *)input->Get(Form("CMNSubStraightLine/hADCPedCMNSub%d",strip)); + hist2 = (TH1F *)input->Get(Form("CMNSubStraightLine/hADCPedCMNSub%d",strip+NSkip)); + hist3 = (TH1F *)input->Get(Form("CMNSubStraightLine/hADCPedCMNSub%d",strip-NSkip)); + hist4; + if (direction == "left") + hist4 = (TH1F *)input->Get(Form("CMNSubStraightLine/hADCPedCMNSub%d",strip-2*NSkip)); + else if (direction == "right") + hist4 = (TH1F *)input->Get(Form("CMNSubStraightLine/hADCPedCMNSub%d",strip+2*NSkip)); + } + else + { + hist = (TH1F *)input->Get(Form("hADCPedSub%d",strip)); + cout << "Histograms: " << endl; + cout << Form("hADCPedSub%d",strip) << endl; + cout << Form("hADCPedSub%d",strip+NSkip) << endl; + cout << Form("hADCPedSub%d",strip-NSkip) << endl; + cout << Form("hADCPedSub%d",strip-2*NSkip) << endl; + cout << Form("hADCPedSub%d",strip+2*NSkip) << endl; + + // Four adjacent strips. + hist1 = (TH1F *)input->Get(Form("hADCPedSub%d",strip)); + hist2 = (TH1F *)input->Get(Form("hADCPedSub%d",strip+NSkip)); + hist3 = (TH1F *)input->Get(Form("hADCPedSub%d",strip-NSkip)); + hist4; + if (direction == "left") + hist4 = (TH1F *)input->Get(Form("hADCPedSub%d",strip-2*NSkip)); + else if (direction == "right") + hist4 = (TH1F *)input->Get(Form("hADCPedSub%d",strip+2*NSkip)); + } + + meanADC[step] = hist->GetMean(); + mean4ADC[step] = hist1->GetMean()+hist2->GetMean()+hist3->GetMean()+hist4->GetMean(); + + // Close input data ROOT files. + input->Close(); + } + + output->cd(); // Only one strip. - TH1D *hist = (TH1D *)input->Get(Form("hADCPedSub%d",strip)); - meanADC[step] = hist->GetMean(); - - cout << "Histograms: " << endl; - cout << Form("hADCPedSub%d",strip) << endl; - cout << Form("hADCPedSub%d",strip+NSkip) << endl; - cout << Form("hADCPedSub%d",strip-NSkip) << endl; - cout << Form("hADCPedSub%d",strip-2*NSkip) << endl; - cout << Form("hADCPedSub%d",strip+2*NSkip) << endl; + TGraph *gbiasVoltageScan = new TGraph(steps,V,meanADC); + InitGraph(gbiasVoltageScan,"Bias voltage scan - 1 strip","Bias voltage (V)","ADC counts"); + TCanvas *cbiasVoltageScan; + if (CMNSub == 1) + cbiasVoltageScan = new TCanvas(Form("cbiasVoltageScan-ComputeCMN-%s",filename),"",400,300); + else + cbiasVoltageScan = new TCanvas(Form("cbiasVoltageScan-%s",filename),"",400,300); + DrawGraph(cbiasVoltageScan,gbiasVoltageScan,"APC",path_to_figures); // Four adjacent strips. - TH1D *hist1 = (TH1D *)input->Get(Form("hADCPedSub%d",strip)); - TH1D *hist2 = (TH1D *)input->Get(Form("hADCPedSub%d",strip+NSkip)); - TH1D *hist3 = (TH1D *)input->Get(Form("hADCPedSub%d",strip-NSkip)); - TH1D *hist4; - if (direction == "left") - hist4 = (TH1D *)input->Get(Form("hADCPedSub%d",strip-2*NSkip)); - else if (direction == "right") - hist4 = (TH1D *)input->Get(Form("hADCPedSub%d",strip+2*NSkip)); - mean4ADC[step] = hist1->GetMean()+hist2->GetMean()+hist3->GetMean()+hist4->GetMean(); + TGraph *gbiasVoltageScan4 = new TGraph(steps,V,mean4ADC); + InitGraph(gbiasVoltageScan4,"Bias voltage scan - 4 adjacent strips","Bias voltage (V)","ADC counts"); + TCanvas *cbiasVoltageScan4; + if (CMNSub == 1) + cbiasVoltageScan4 = new TCanvas(Form("cbiasVoltageScan4-ComputeCMN-%s",filename),"",400,300); + else + cbiasVoltageScan4 = new TCanvas(Form("cbiasVoltageScan4-%s",filename),"",400,300); + DrawGraph(cbiasVoltageScan4,gbiasVoltageScan4,"APC",path_to_figures); - // Close input data ROOT files. - input->Close(); - } + // Write output ROOT file. + output->Write(); - output->cd(); + // Close output ROOT file. + output->Close(); - // Only one strip. - TGraph *gbiasVoltageScan = new TGraph(steps,V,meanADC); - InitGraph(gbiasVoltageScan,"Bias voltage scan - 1 strip","Bias voltage (V)","ADC counts"); - TCanvas *cbiasVoltageScan = new TCanvas(Form("cbiasVoltageScan-%s",filename),"",400,300); - DrawGraph(cbiasVoltageScan,gbiasVoltageScan,"APC",path_to_figures); - - // Four adjacent strips. - TGraph *gbiasVoltageScan4 = new TGraph(steps,V,mean4ADC); - InitGraph(gbiasVoltageScan4,"Bias voltage scan - 4 adjacent strips","Bias voltage (V)","ADC counts"); - TCanvas *cbiasVoltageScan4 = new TCanvas(Form("cbiasVoltageScan4-%s",filename),"",400,300); - DrawGraph(cbiasVoltageScan4,gbiasVoltageScan4,"APC",path_to_figures); - - // Write output ROOT file. - output->Write(); - - // Close output ROOT file. - output->Close(); - - return; + return; } diff --git a/Software/ComputeCMN/CMNSubMean.C b/Software/ComputeCMN/CMNSubMean.C new file mode 100644 index 0000000..d9d0fac --- /dev/null +++ b/Software/ComputeCMN/CMNSubMean.C @@ -0,0 +1,245 @@ +//************************************************ +// Author: Federica Lionetto +// Created on: 03/12/2014 +//************************************************ + +/* + CMNSubMean is one of the CMN subtraction algorithms. + + Pedestal subtracted ADC counts ---> Exclude signal (requiring |ADC| Calculate mean ---> Subtract mean ---> Pedestal and CMN subtracted ADC counts. + + It loops over events, creates the event-by-event distribution of the pedestal subtracted ADC counts (hADCPedSubBeetlex_1evt), ignores strips that may potentially contain a signal (by setting a threshold) and creates the event-by-event distribution of the pedestal subtracted ADC counts (hADCPedSubBeetlexNoSig_1evt), calculates the average, subtracts it to every strip, and creates the event-by-event distribution of the pedestal and CMN subtracted ADC counts (hADCPedCMNSubBeetlex_1evt). + If there is no common mode noise, the pedestal and the pedestal and CMN versions will look the same. + + It creates the distribution of the CMN (hCMNBeetlex). + + It creates the distribution of the pedestal subtracted ADC counts (hADCPedSubBeetlex) and the distribution of the pedestal and CMN subtracted ADC counts (hADCPedCMNSubBeetlex), comparing the two. + + The configuration of the CMN algorithm is defined by th1 and th2. + The other arguments are: + - the number of one event to display, to check that the algorithm is working properly; + - the string corresponding to the input ROOT file, where to get the pedestal subtracted ADC counts from; + - the pointer to the output ROOT file, where to save the output of this algorithm; + - the string corresponding to the path where to save the pictures. + + CMNSubMean will create a directory in the output ROOT file called "CMNSubMean", where the tree (with CMN1, CMN2, and ADCPedCMNSub) and the histograms, graphs, and canvases will be stored. + */ + +// Header guard. +#ifndef __CMNSubMean_C_INCLUDED__ +#define __CMNSubMean_C_INCLUDED__ + +void CMNSubMean(float th1, float th2, int sample, string input_ROOT, TFile *output, TString path_to_figures); + +void CMNSubMean(float th1, float th2, int sample, string input_ROOT, TFile *output, TString path_to_figures) +{ + cout << "**************************************************" << endl; + cout << "Computing CMN according to the mean algorithm..." << endl; + cout << "**************************************************" << endl; + + cout << "**************************************************" << endl; + cout << "Configuration" << endl; + cout << "th1: " << th1 << endl; + cout << "th2: " << th2 << endl; + cout << "sample: " << sample << endl; + cout << "**************************************************" << endl; + + // Open input ROOT file. + cout << "Open input ROOT file: " << input_ROOT << endl; + TFile *input = TFile::Open(TString(input_ROOT)); + + input->cd(); + TTree *EventInfo = (TTree *)input->Get("EventInfo"); + int NEvents = EventInfo->GetEntries(); + + TString dirCMNSubMean = "CMNSubMean"; + output->cd(); + output->mkdir(dirCMNSubMean); + output->cd(dirCMNSubMean); + + TString alg_path_to_figures = path_to_figures+dirCMNSubMean; + TString alg_path_to_make_figures = "mkdir -p "+alg_path_to_figures; + system(alg_path_to_make_figures.Data()); + + // Copy the EventInfo tree from the input to the output file and add some more information. + float CMN1 = 0.; + float CMN2 = 0.; + std::vector ADCPedCMNSub; // Raw ADC - pedestal - CMN. + + TTree *EventInfoProcessed = EventInfo->CloneTree(0); + std::vector *ADCProcessed = 0; + TBranch *b_ADCProcessed = 0; + EventInfo->SetBranchAddress("ADCProcessed",&ADCProcessed,&b_ADCProcessed); + EventInfoProcessed->Branch("CMN1",&CMN1); + EventInfoProcessed->Branch("CMN2",&CMN2); + EventInfoProcessed->Branch("ADCPedCMNSub",&ADCPedCMNSub); + + // Event-by-event histograms. + + // Event-by-event distribution of the pedestal subtracted ADC counts (hADCPedSubBeetlex_1evt). + TH1F *hADCPedSubBeetle1_1evt = new TH1F("hADCPedSubBeetle1_1evt","",400,-200,200); // Modify it. + TCanvas *cADCPedSubBeetle1_1evt = new TCanvas("cADCPedSubBeetle1_1evt","",400,300); + InitHist(hADCPedSubBeetle1_1evt,"Pedestal subtracted ADC counts on Beetle 1","ADC counts",""); + + TH1F *hADCPedSubBeetle2_1evt = new TH1F("hADCPedSubBeetle2_1evt","",400,-200,200); //Modify it. + TCanvas *cADCPedSubBeetle2_1evt = new TCanvas("cADCPedSubBeetle2_1evt","",400,300); + InitHist(hADCPedSubBeetle2_1evt,"Pedestal subtracted ADC counts on Beetle 2","ADC counts",""); + + // Ignore strips that may potentially contain a signal (by setting a threshold). + // Event-by-event distribution of the pedestal subtracted ADC counts (hADCPedSubBeetlexNoSig_1evt). + TH1F *hADCPedSubBeetle1NoSig_1evt = new TH1F("hADCPedSubBeetle1NoSig_1evt","",400,-200,200); // Modify it. + TCanvas *cADCPedSubBeetle1NoSig_1evt = new TCanvas("cADCPedSubBeetle1NoSig_1evt","",400,300); + InitHist(hADCPedSubBeetle1NoSig_1evt,"Pedestal subtracted ADC counts on Beetle 1 - excluding signal","ADC counts",""); + + TH1F *hADCPedSubBeetle2NoSig_1evt = new TH1F("hADCPedSubBeetle2NoSig_1evt","",400,-200,200); //Modify it. + TCanvas *cADCPedSubBeetle2NoSig_1evt = new TCanvas("cADCPedSubBeetle2NoSig_1evt","",400,300); + InitHist(hADCPedSubBeetle2NoSig_1evt,"Pedestal subtracted ADC counts on Beetle 2 - excluding signal","ADC counts",""); + + // Event-by-event distribution of the pedestal and CMN subtracted ADC counts (hADCPedCMNSubBeetlex_1evt). + TH1F *hADCPedCMNSubBeetle1_1evt = new TH1F("hADCPedCMNSubBeetle1_1evt","",400,-200,200); // Modify it. + TCanvas *cADCPedCMNSubBeetle1_1evt = new TCanvas("cADCPedCMNSubBeetle1_1evt","",400,300); + InitHist(hADCPedCMNSubBeetle1_1evt,"Pedestal and CMN subtracted ADC counts on Beetle 1","ADC counts",""); + + TH1F *hADCPedCMNSubBeetle2_1evt = new TH1F("hADCPedCMNSubBeetle2_1evt","",400,-200,200); //Modify it. + TCanvas *cADCPedCMNSubBeetle2_1evt = new TCanvas("cADCPedCMNSubBeetle2_1evt","",400,300); + InitHist(hADCPedCMNSubBeetle2_1evt,"Pedestal and CMN subtracted ADC counts on Beetle 2","ADC counts",""); + + // Histograms containing the information on all events. + + // CMN1. + TH1F *hCMNBeetle1 = new TH1F("hCMNBeetle1","",2*th1,-th1,th1); // Modify it. + TCanvas *cCMNBeetle1 = new TCanvas("cCMNBeetle1","",400,300); + InitHist(hCMNBeetle1,"CMN on Beetle 1","ADC counts",""); + + // CMN2. + TH1F *hCMNBeetle2 = new TH1F("hCMNBeetle2","",2*th2,-th2,th2); // Modify it. + TCanvas *cCMNBeetle2 = new TCanvas("cCMNBeetle2","",400,300); + InitHist(hCMNBeetle2,"CMN on Beetle 2","ADC counts",""); + + // Distribution of the pedestal subtracted ADC counts (hADCPedSubBeetlex). + TH1F *hADCPedSubBeetle1 = new TH1F("hADCPedSubBeetle1","",400,-200,200); + InitHist(hADCPedSubBeetle1,"Pedestal subtracted ADC counts on Beetle 1","ADC counts",""); + TH1F *hADCPedSubBeetle2 = new TH1F("hADCPedSubBeetle2","",400,-200,200); + InitHist(hADCPedSubBeetle2,"Pedestal subtracted ADC counts on Beetle 2","ADC counts",""); + + // Distribution of the pedestal and CMN subtracted ADC counts (hADCPedCMNSubBeetlex). + TH1F *hADCPedCMNSubBeetle1 = new TH1F("hADCPedCMNSubBeetle1","",400,-200,200); + InitHist(hADCPedCMNSubBeetle1,"Pedestal and CMN subtracted ADC counts on Beetle 1","ADC counts",""); + TH1F *hADCPedCMNSubBeetle2 = new TH1F("hADCPedCMNSubBeetle2","",400,-200,200); + InitHist(hADCPedCMNSubBeetle2,"Pedestal and CMN subtracted ADC counts on Beetle 2","ADC counts",""); + + TCanvas *cADCCompBeetle1 = new TCanvas("cADCCompBeetle1","",400,300); + TCanvas *cADCCompBeetle2 = new TCanvas("cADCCompBeetle2","",400,300); + + // Add the histograms with the pedestal and CMN subtracted distribution of the ADC counts of each Beetle channel (TH1F *hADCPedCMNSub[N]) to the output file. + TH1F *hADCPedCMNSub[N]; + for (int iChannel=0;iChannel0) + { + ADCPedCMNSub.clear(); + hADCPedSubBeetle1_1evt->Reset(); + hADCPedSubBeetle2_1evt->Reset(); + hADCPedSubBeetle1NoSig_1evt->Reset(); + hADCPedSubBeetle2NoSig_1evt->Reset(); + hADCPedCMNSubBeetle1_1evt->Reset(); + hADCPedCMNSubBeetle2_1evt->Reset(); + } + + EventInfo->GetEntry(iEvent); + + // Fill histograms for Beetle 1. + for (int iChannel=0;iChannelFill((float)ADCProcessed->at(iChannel)); + hADCPedSubBeetle1_1evt->Fill((float)ADCProcessed->at(iChannel)); + if (abs((float)ADCProcessed->at(iChannel))Fill((float)ADCProcessed->at(iChannel)); + } + } + + // Calculate CMN1. + CMN1 = hADCPedSubBeetle1NoSig_1evt->GetMean(); + hCMNBeetle1->Fill(CMN1); + + // Fill histograms for Beetle 2. + for (int iChannel=NBeetle;iChannelFill((float)ADCProcessed->at(iChannel)); + hADCPedSubBeetle2_1evt->Fill((float)ADCProcessed->at(iChannel)); + if (abs((float)ADCProcessed->at(iChannel))Fill((float)ADCProcessed->at(iChannel)); + } + } + + // Calculate CMN2. + CMN2 = hADCPedSubBeetle2NoSig_1evt->GetMean(); + hCMNBeetle2->Fill(CMN2); + + // Subtract CMN1. + for (int iChannel=0;iChannelat(iChannel)-CMN1); + hADCPedCMNSub[iChannel]->Fill((float)ADCProcessed->at(iChannel)-CMN1); + if (maskBeetle1[iChannel] == 0) + { + hADCPedCMNSubBeetle1->Fill((float)ADCProcessed->at(iChannel)-CMN1); + hADCPedCMNSubBeetle1_1evt->Fill((float)ADCProcessed->at(iChannel)-CMN1); + } + } + + // Subtract CMN2. + for (int iChannel=NBeetle;iChannelat(iChannel)-CMN2); + hADCPedCMNSub[iChannel]->Fill((float)ADCProcessed->at(iChannel)-CMN2); + if (maskBeetle2[iChannel-NBeetle] == 0) + { + hADCPedCMNSubBeetle2->Fill((float)ADCProcessed->at(iChannel)-CMN2); + hADCPedCMNSubBeetle2_1evt->Fill((float)ADCProcessed->at(iChannel)-CMN2); + } + } + + EventInfoProcessed->Fill(); + + if (iEvent==sample) { + DrawHist(cADCPedSubBeetle1_1evt,hADCPedSubBeetle1_1evt,"",alg_path_to_figures); + DrawHist(cADCPedSubBeetle2_1evt,hADCPedSubBeetle2_1evt,"",alg_path_to_figures); + DrawHist(cADCPedSubBeetle1NoSig_1evt,hADCPedSubBeetle1NoSig_1evt,"",alg_path_to_figures); + DrawHist(cADCPedSubBeetle2NoSig_1evt,hADCPedSubBeetle2NoSig_1evt,"",alg_path_to_figures); + DrawHist(cADCPedCMNSubBeetle1_1evt,hADCPedCMNSubBeetle1_1evt,"",alg_path_to_figures); + DrawHist(cADCPedCMNSubBeetle2_1evt,hADCPedCMNSubBeetle2_1evt,"",alg_path_to_figures); + } + + } + + DrawHist(cCMNBeetle1,hCMNBeetle1,"",alg_path_to_figures); + DrawHist(cCMNBeetle2,hCMNBeetle2,"",alg_path_to_figures); + + TLegend *legADCCompBeetle1 = CreateLegend2(hADCPedSubBeetle1,"ped sub",hADCPedCMNSubBeetle1,"ped + CMN sub"); + TLegend *legADCCompBeetle2 = CreateLegend2(hADCPedSubBeetle2,"ped sub",hADCPedCMNSubBeetle2,"ped + CMN sub"); + + cADCCompBeetle1->SetLogy(); + cADCCompBeetle2->SetLogy(); + + DrawHistCompare(cADCCompBeetle1,hADCPedSubBeetle1,hADCPedCMNSubBeetle1,legADCCompBeetle1,alg_path_to_figures); + DrawHistCompare(cADCCompBeetle2,hADCPedSubBeetle2,hADCPedCMNSubBeetle2,legADCCompBeetle2,alg_path_to_figures); + + output->cd(); + + // Close input ROOT file. + input->Close(); + + return; +} + +#endif diff --git a/Software/ComputeCMN/CMNSubMean2.C b/Software/ComputeCMN/CMNSubMean2.C new file mode 100644 index 0000000..8f68560 --- /dev/null +++ b/Software/ComputeCMN/CMNSubMean2.C @@ -0,0 +1,408 @@ +//************************************************ +// Author: Federica Lionetto +// Created on: 03/12/2014 +//************************************************ + +/* + CMNSubMean is one of the CMN subtraction algorithms. + + Pedestal subtracted ADC counts ---> Calculate mean and rms ---> Exclude signal (requiring |ADC-mean| Calculate mean and rms ---> Exclude signal (requiring |ADC-mean| Calculate mean ---> Subtract mean ---> Pedestal and CMN subtracted ADC counts. + + It loops over events, creates the event-by-event distribution of the pedestal subtracted ADC counts (hADCPedSubBeetlex_1evt), calculates the mean and the rms, ignores strips that may potentially contain a signal and creates the event-by-event distribution of the pedestal subtracted ADC counts (hADCPedSubBeetlexNoSig_1evt), calculates the mean and the rms, ignores strips that may potentially contain a signal and creates the event-by-event distribution of the pedestal subtracted ADC counts (hADCPedSubBeetlexNoSig2_1evt), calculates the average, subtracts it to every strip, and creates the event-by-event distribution of the pedestal and CMN subtracted ADC counts (hADCPedCMNSubBeetlex_1evt). + If there is no common mode noise, the pedestal and the pedestal and CMN versions will look the same. + + It creates the distribution of the CMN (hCMNBeetlex). + + It creates the distribution of the pedestal subtracted ADC counts (hADCPedSubBeetlex) and the distribution of the pedestal and CMN subtracted ADC counts (hADCPedCMNSubBeetlex), comparing the two. + + It creates the distribution of the RMS of the ADC count distribution for the following cases: + - pedestal subtracted ADC counts; + - pedestal subtracted ADC counts, after the first outlier removal; + - pedestal subtracted ADC counts, after the second outlier removal. + + In beam off data the ADC count distribution after CMN subtraction is not symmetric. + This might be explained by muons coming from the beam line and acting as "signal". + To check this hypothesis, it is interesting to look at the distribution of the Beetle channels contributing to the tail on the right (TH1F *hchTailBeetlex) and the distribution of the event numbers where this happens (TH1F *hevTailBeetlex). + + The configuration of the CMN algorithm is defined by factor. + The other arguments are: + - the number of one event to display, to check that the algorithm is working properly; + - the string corresponding to the input ROOT file, where to get the pedestal subtracted ADC counts from; + - the pointer to the output ROOT file, where to save the output of this algorithm; + - the string corresponding to the path where to save the pictures. + + CMNSubMean2 will create a directory in the output ROOT file called "CMNSubMean2", where the tree (with CMN1, CMN2, and ADCPedCMNSub) and the histograms, graphs, and canvases will be stored. + */ + +// Header guard. +#ifndef __CMNSUBMEAN2_C_INCLUDED__ +#define __CMNSUBMEAN2_C_INCLUDED__ + +void CMNSubMean2(float factor, int sample, string input_ROOT, TFile *output, TString path_to_figures); + +void CMNSubMean2(float factor, int sample, string input_ROOT, TFile *output, TString path_to_figures) +{ + cout << "**************************************************" << endl; + cout << "Computing CMN according to the mean 2 algorithm..." << endl; + cout << "**************************************************" << endl; + + cout << "**************************************************" << endl; + cout << "Configuration" << endl; + cout << "factor: " << factor << endl; + cout << "sample: " << sample << endl; + cout << "**************************************************" << endl; + + // Open input ROOT file. + cout << "Open input ROOT file: " << input_ROOT << endl; + TFile *input = TFile::Open(TString(input_ROOT)); + + input->cd(); + TTree *EventInfo = (TTree *)input->Get("EventInfo"); + int NEvents = EventInfo->GetEntries(); + + TString dirCMNSubMean2 = "CMNSubMean2"; + output->cd(); + output->mkdir(dirCMNSubMean2); + output->cd(dirCMNSubMean2); + + TString alg_path_to_figures = path_to_figures+dirCMNSubMean2; + TString alg_path_to_make_figures = "mkdir -p "+alg_path_to_figures; + system(alg_path_to_make_figures.Data()); + + // Copy the EventInfo tree from the input to the output file and add some more information. + float CMN1 = 0.; + float CMN2 = 0.; + std::vector ADCPedCMNSub; // Raw ADC - pedestal - CMN. + + TTree *EventInfoProcessed = EventInfo->CloneTree(0); + std::vector *ADCProcessed = 0; + TBranch *b_ADCProcessed = 0; + EventInfo->SetBranchAddress("ADCProcessed",&ADCProcessed,&b_ADCProcessed); + EventInfoProcessed->Branch("CMN1",&CMN1); + EventInfoProcessed->Branch("CMN2",&CMN2); + EventInfoProcessed->Branch("ADCPedCMNSub",&ADCPedCMNSub); + + // Event-by-event histograms. + + // Event-by-event distribution of the pedestal subtracted ADC counts (hADCPedSubBeetlex_1evt). + TH1F *hADCPedSubBeetle1_1evt = new TH1F("hADCPedSubBeetle1_1evt","",400,-200,200); // Modify it. + TCanvas *cADCPedSubBeetle1_1evt = new TCanvas("cADCPedSubBeetle1_1evt","",400,300); + InitHist(hADCPedSubBeetle1_1evt,"Pedestal subtracted ADC counts on Beetle 1","ADC counts",""); + + TH1F *hADCPedSubBeetle2_1evt = new TH1F("hADCPedSubBeetle2_1evt","",400,-200,200); //Modify it. + TCanvas *cADCPedSubBeetle2_1evt = new TCanvas("cADCPedSubBeetle2_1evt","",400,300); + InitHist(hADCPedSubBeetle2_1evt,"Pedestal subtracted ADC counts on Beetle 2","ADC counts",""); + + // Ignore strips that may potentially contain a signal. + // Event-by-event distribution of the pedestal subtracted ADC counts (hADCPedSubBeetlexNoSig_1evt). + + // First iteration. + TH1F *hADCPedSubBeetle1NoSig_1evt = new TH1F("hADCPedSubBeetle1NoSig_1evt","",400,-200,200); // Modify it. + TCanvas *cADCPedSubBeetle1NoSig_1evt = new TCanvas("cADCPedSubBeetle1NoSig_1evt","",400,300); + InitHist(hADCPedSubBeetle1NoSig_1evt,"Pedestal subtracted ADC counts on Beetle 1 - excluding signal","ADC counts",""); + + TH1F *hADCPedSubBeetle2NoSig_1evt = new TH1F("hADCPedSubBeetle2NoSig_1evt","",400,-200,200); //Modify it. + TCanvas *cADCPedSubBeetle2NoSig_1evt = new TCanvas("cADCPedSubBeetle2NoSig_1evt","",400,300); + InitHist(hADCPedSubBeetle2NoSig_1evt,"Pedestal subtracted ADC counts on Beetle 2 - excluding signal","ADC counts",""); + + // Second iteration. + TH1F *hADCPedSubBeetle1NoSig2_1evt = new TH1F("hADCPedSubBeetle1NoSig2_1evt","",400,-200,200); // Modify it. + TCanvas *cADCPedSubBeetle1NoSig2_1evt = new TCanvas("cADCPedSubBeetle1NoSig2_1evt","",400,300); + InitHist(hADCPedSubBeetle1NoSig2_1evt,"Pedestal subtracted ADC counts on Beetle 1 - excluding signal","ADC counts",""); + + TH1F *hADCPedSubBeetle2NoSig2_1evt = new TH1F("hADCPedSubBeetle2NoSig2_1evt","",400,-200,200); //Modify it. + TCanvas *cADCPedSubBeetle2NoSig2_1evt = new TCanvas("cADCPedSubBeetle2NoSig2_1evt","",400,300); + InitHist(hADCPedSubBeetle2NoSig2_1evt,"Pedestal subtracted ADC counts on Beetle 2 - excluding signal","ADC counts",""); + + // Event-by-event distribution of the pedestal and CMN subtracted ADC counts (hADCPedCMNSubBeetlex_1evt). + TH1F *hADCPedCMNSubBeetle1_1evt = new TH1F("hADCPedCMNSubBeetle1_1evt","",400,-200,200); // Modify it. + TCanvas *cADCPedCMNSubBeetle1_1evt = new TCanvas("cADCPedCMNSubBeetle1_1evt","",400,300); + InitHist(hADCPedCMNSubBeetle1_1evt,"Pedestal and CMN subtracted ADC counts on Beetle 1","ADC counts",""); + + TH1F *hADCPedCMNSubBeetle2_1evt = new TH1F("hADCPedCMNSubBeetle2_1evt","",400,-200,200); //Modify it. + TCanvas *cADCPedCMNSubBeetle2_1evt = new TCanvas("cADCPedCMNSubBeetle2_1evt","",400,300); + InitHist(hADCPedCMNSubBeetle2_1evt,"Pedestal and CMN subtracted ADC counts on Beetle 2","ADC counts",""); + + // Histograms containing the information on all events. + + // CMN1. + TH1F *hCMNBeetle1 = new TH1F("hCMNBeetle1","",100,-50,50); // Modify it. + TCanvas *cCMNBeetle1 = new TCanvas("cCMNBeetle1","",400,300); + InitHist(hCMNBeetle1,"CMN on Beetle 1","ADC counts",""); + + // CMN2. + TH1F *hCMNBeetle2 = new TH1F("hCMNBeetle2","",100,-50,50); // Modify it. + TCanvas *cCMNBeetle2 = new TCanvas("cCMNBeetle2","",400,300); + InitHist(hCMNBeetle2,"CMN on Beetle 2","ADC counts",""); + + // Distribution of the pedestal subtracted ADC counts (hADCPedSubBeetlex). + TH1F *hADCPedSubBeetle1 = new TH1F("hADCPedSubBeetle1","",400,-200,200); + InitHist(hADCPedSubBeetle1,"Pedestal subtracted ADC counts on Beetle 1","ADC counts",""); + TH1F *hADCPedSubBeetle2 = new TH1F("hADCPedSubBeetle2","",400,-200,200); + InitHist(hADCPedSubBeetle2,"Pedestal subtracted ADC counts on Beetle 2","ADC counts",""); + + // Distribution of the pedestal and CMN subtracted ADC counts (hADCPedCMNSubBeetlex). + TH1F *hADCPedCMNSubBeetle1 = new TH1F("hADCPedCMNSubBeetle1","",400,-200,200); + InitHist(hADCPedCMNSubBeetle1,"Pedestal and CMN subtracted ADC counts on Beetle 1","ADC counts",""); + TH1F *hADCPedCMNSubBeetle2 = new TH1F("hADCPedCMNSubBeetle2","",400,-200,200); + InitHist(hADCPedCMNSubBeetle2,"Pedestal and CMN subtracted ADC counts on Beetle 2","ADC counts",""); + + TCanvas *cADCCompBeetle1 = new TCanvas("cADCCompBeetle1","",400,300); + TCanvas *cADCCompBeetle2 = new TCanvas("cADCCompBeetle2","",400,300); + + // Distribution of the RMS of the ADC count distribution for the following cases: + // - pedestal subtracted ADC counts; + // - pedestal subtracted ADC counts, after the first outlier removal; + // - pedestal subtracted ADC counts, after the second outlier removal. + TH1F *hRMSPedSubBeetle1 = new TH1F("hRMSPedSubBeetle1","",90,0,30); + TH1F *hRMSPedSubBeetle1NoSig = new TH1F("hRMSPedSubBeetle1NoSig","",90,0,30); + TH1F *hRMSPedSubBeetle1NoSig2 = new TH1F("hRMSPedSubBeetle1NoSig2","",90,0,30); + TH1F *hRMSPedSubBeetle2 = new TH1F("hRMSPedSubBeetle2","",90,0,30); + TH1F *hRMSPedSubBeetle2NoSig = new TH1F("hRMSPedSubBeetle2NoSig","",90,0,30); + TH1F *hRMSPedSubBeetle2NoSig2 = new TH1F("hRMSPedSubBeetle2NoSig2","",90,0,30); + + InitHist(hRMSPedSubBeetle1,"RMS of pedestal subtracted ADC counts on Beetle 1","RMS (ADC counts)",""); + InitHist(hRMSPedSubBeetle1NoSig,"RMS of pedestal subtracted ADC counts on Beetle 1","RMS (ADC counts)",""); + InitHist(hRMSPedSubBeetle1NoSig2,"RMS of pedestal subtracted ADC counts on Beetle 1","RMS (ADC counts)",""); + InitHist(hRMSPedSubBeetle2,"RMS of pedestal subtracted ADC counts on Beetle 2","RMS (ADC counts)",""); + InitHist(hRMSPedSubBeetle2NoSig,"RMS of pedestal subtracted ADC counts on Beetle 2","RMS (ADC counts)",""); + InitHist(hRMSPedSubBeetle2NoSig2,"RMS of pedestal subtracted ADC counts on Beetle 2","RMS (ADC counts)",""); + + TCanvas *cRMSBeetle1 = new TCanvas("cRMSBeetle1","",400,300); + TCanvas *cRMSBeetle2 = new TCanvas("cRMSBeetle2","",400,300); + + // In beam off data the ADC count distribution after CMN subtraction is not symmetric. + // This might be explained by muons coming from the beam line and acting as "signal". + // To check this hypothesis, it is interesting to look at the distribution of the Beetle channels contributing to the tail on the right (TH1F *hchTailBeetlex) and the distribution of the event numbers where this happens (TH1F *hevTailBeetlex). + TH1F *hchTailBeetle1 = new TH1F("hcdTailBeetle1","",NBeetle,0,NBeetle); + TH1F *hchTailBeetle2 = new TH1F("hcdTailBeetle2","",NBeetle,NBeetle,N); + + InitHist(hchTailBeetle1,"Asymmetric tail on Beetle 1","Beetle channel",""); + InitHist(hchTailBeetle2,"Asymmetric tail on Beetle 2","Beetle channel",""); + + TCanvas *cchTailBeetle1 = new TCanvas("cchTailBeetle1","",400,300); + TCanvas *cchTailBeetle2 = new TCanvas("cchTailBeetle2","",400,300); + + TH1F *hevTailBeetle1 = new TH1F("hevTailBeetle1","",50,0,NEvents+1); + TH1F *hevTailBeetle2 = new TH1F("hevTailBeetle2","",50,0,NEvents+1); + + InitHist(hevTailBeetle1,"Asymmetric tail on Beetle 1","Event number",""); + InitHist(hevTailBeetle2,"Asymmetric tail on Beetle 2","Event number",""); + + TCanvas *cevTailBeetle1 = new TCanvas("cevTailBeetle1","",400,300); + TCanvas *cevTailBeetle2 = new TCanvas("cevTailBeetle2","",400,300); + + // Add the histograms with the pedestal and CMN subtracted distribution of the ADC counts of each Beetle channel (TH1F *hADCPedCMNSub[N]) to the output file. + TH1F *hADCPedCMNSub[N]; + for (int iChannel=0;iChannel0) + { + ADCPedCMNSub.clear(); + hADCPedSubBeetle1_1evt->Reset(); + hADCPedSubBeetle2_1evt->Reset(); + hADCPedSubBeetle1NoSig_1evt->Reset(); + hADCPedSubBeetle2NoSig_1evt->Reset(); + hADCPedSubBeetle1NoSig2_1evt->Reset(); + hADCPedSubBeetle2NoSig2_1evt->Reset(); + hADCPedCMNSubBeetle1_1evt->Reset(); + hADCPedCMNSubBeetle2_1evt->Reset(); + } + + EventInfo->GetEntry(iEvent); + + // Fill histograms for Beetle 1. + for (int iChannel=0;iChannelFill((float)ADCProcessed->at(iChannel)); + hADCPedSubBeetle1_1evt->Fill((float)ADCProcessed->at(iChannel)); + } + } + + // Exclude signal. + meanBeetle1_temp = hADCPedSubBeetle1_1evt->GetMean(); + rmsBeetle1_temp = hADCPedSubBeetle1_1evt->GetRMS(); + + hRMSPedSubBeetle1->Fill(rmsBeetle1_temp); + + // Fill histograms again for Beetle 1. + for (int iChannel=0;iChannelat(iChannel)-meanBeetle1_temp)Fill((float)ADCProcessed->at(iChannel)); + } + } + + // Exclude signal. + meanBeetle1_temp = hADCPedSubBeetle1NoSig_1evt->GetMean(); + rmsBeetle1_temp = hADCPedSubBeetle1NoSig_1evt->GetRMS(); + + hRMSPedSubBeetle1NoSig->Fill(rmsBeetle1_temp); + + // Fill histograms again for Beetle 1. + for (int iChannel=0;iChannelat(iChannel)-meanBeetle1_temp)Fill((float)ADCProcessed->at(iChannel)); + } + } + + // Calculate CMN1. + CMN1 = hADCPedSubBeetle1NoSig2_1evt->GetMean(); + rmsBeetle1_temp = hADCPedSubBeetle1NoSig2_1evt->GetRMS(); + + hRMSPedSubBeetle1NoSig2->Fill(rmsBeetle1_temp); + + hCMNBeetle1->Fill(CMN1); + + // Fill histograms for Beetle 2. + for (int iChannel=NBeetle;iChannelFill((float)ADCProcessed->at(iChannel)); + hADCPedSubBeetle2_1evt->Fill((float)ADCProcessed->at(iChannel)); + } + } + + // Exclude signal. + meanBeetle2_temp = hADCPedSubBeetle2_1evt->GetMean(); + rmsBeetle2_temp = hADCPedSubBeetle2_1evt->GetRMS(); + + hRMSPedSubBeetle2->Fill(rmsBeetle2_temp); + + // Fill histograms again for Beetle 2. + for (int iChannel=NBeetle;iChannelat(iChannel)-meanBeetle2_temp)Fill((float)ADCProcessed->at(iChannel)); + } + } + + // Exclude signal. + meanBeetle2_temp = hADCPedSubBeetle2NoSig_1evt->GetMean(); + rmsBeetle2_temp = hADCPedSubBeetle2NoSig_1evt->GetRMS(); + + hRMSPedSubBeetle2NoSig->Fill(rmsBeetle2_temp); + + // Fill histograms again for Beetle 2. + for (int iChannel=NBeetle;iChannelat(iChannel)-meanBeetle2_temp)Fill((float)ADCProcessed->at(iChannel)); + } + } + + // Calculate CMN2. + CMN2 = hADCPedSubBeetle2NoSig2_1evt->GetMean(); + rmsBeetle2_temp = hADCPedSubBeetle2NoSig2_1evt->GetRMS(); + + hRMSPedSubBeetle2NoSig2->Fill(rmsBeetle2_temp); + + hCMNBeetle2->Fill(CMN2); + + // Subtract CMN1. + for (int iChannel=0;iChannelat(iChannel)-CMN1); + hADCPedCMNSub[iChannel]->Fill((float)ADCProcessed->at(iChannel)-CMN1); + if (maskBeetle1[iChannel] == 0) + { + hADCPedCMNSubBeetle1->Fill((float)ADCProcessed->at(iChannel)-CMN1); + hADCPedCMNSubBeetle1_1evt->Fill((float)ADCProcessed->at(iChannel)-CMN1); + if (((float)ADCProcessed->at(iChannel)-CMN1) > 30.) + { + cout << "The event #" << iEvent << " has at least one Beetle channels (" << iChannel << ") contributing to the tail" << endl; + hchTailBeetle1->Fill(iChannel); + hevTailBeetle1->Fill(iEvent); + } + } + } + + // Subtract CMN2. + for (int iChannel=NBeetle;iChannelat(iChannel)-CMN2); + hADCPedCMNSub[iChannel]->Fill((float)ADCProcessed->at(iChannel)-CMN2); + if (maskBeetle2[iChannel-NBeetle] == 0) + { + hADCPedCMNSubBeetle2->Fill((float)ADCProcessed->at(iChannel)-CMN2); + hADCPedCMNSubBeetle2_1evt->Fill((float)ADCProcessed->at(iChannel)-CMN2); + if (((float)ADCProcessed->at(iChannel)-CMN2) > 30.) + { + cout << "The event #" << iEvent << " has at least one Beetle channels (" << iChannel << ") contributing to the tail" << endl; + hchTailBeetle2->Fill(iChannel); + hevTailBeetle2->Fill(iEvent); + } + } + } + + EventInfoProcessed->Fill(); + + if (iEvent==sample) { + DrawHist(cADCPedSubBeetle1_1evt,hADCPedSubBeetle1_1evt,"",alg_path_to_figures); + DrawHist(cADCPedSubBeetle2_1evt,hADCPedSubBeetle2_1evt,"",alg_path_to_figures); + DrawHist(cADCPedSubBeetle1NoSig_1evt,hADCPedSubBeetle1NoSig_1evt,"",alg_path_to_figures); + DrawHist(cADCPedSubBeetle2NoSig_1evt,hADCPedSubBeetle2NoSig_1evt,"",alg_path_to_figures); + DrawHist(cADCPedSubBeetle1NoSig2_1evt,hADCPedSubBeetle1NoSig2_1evt,"",alg_path_to_figures); + DrawHist(cADCPedSubBeetle2NoSig2_1evt,hADCPedSubBeetle2NoSig2_1evt,"",alg_path_to_figures); + DrawHist(cADCPedCMNSubBeetle1_1evt,hADCPedCMNSubBeetle1_1evt,"",alg_path_to_figures); + DrawHist(cADCPedCMNSubBeetle2_1evt,hADCPedCMNSubBeetle2_1evt,"",alg_path_to_figures); + } + + } + + DrawHist(cCMNBeetle1,hCMNBeetle1,"",alg_path_to_figures); + DrawHist(cCMNBeetle2,hCMNBeetle2,"",alg_path_to_figures); + + TLegend *legADCCompBeetle1 = CreateLegend2(hADCPedSubBeetle1,"ped sub",hADCPedCMNSubBeetle1,"ped + CMN sub"); + TLegend *legADCCompBeetle2 = CreateLegend2(hADCPedSubBeetle2,"ped sub",hADCPedCMNSubBeetle2,"ped + CMN sub"); + + cADCCompBeetle1->SetLogy(); + cADCCompBeetle2->SetLogy(); + + DrawHistCompare(cADCCompBeetle1,hADCPedSubBeetle1,hADCPedCMNSubBeetle1,legADCCompBeetle1,alg_path_to_figures); + DrawHistCompare(cADCCompBeetle2,hADCPedSubBeetle2,hADCPedCMNSubBeetle2,legADCCompBeetle2,alg_path_to_figures); + + TLegend *legRMSBeetle1 = CreateLegend3(hRMSPedSubBeetle1,"ped sub",hRMSPedSubBeetle1NoSig,"after 1st outlier removal",hRMSPedSubBeetle1NoSig2,"after 2nd outlier removal","lpfw",0.42,0.59,0.94,0.89); + TLegend *legRMSBeetle2 = CreateLegend3(hRMSPedSubBeetle2,"ped sub",hRMSPedSubBeetle2NoSig,"after 1st outlier removal",hRMSPedSubBeetle2NoSig2,"after 2nd outlier removal","lpfw",0.42,0.59,0.94,0.89); + + DrawHistCompare3(cRMSBeetle1,hRMSPedSubBeetle1,hRMSPedSubBeetle1NoSig,hRMSPedSubBeetle1NoSig2,legRMSBeetle1,alg_path_to_figures); + DrawHistCompare3(cRMSBeetle2,hRMSPedSubBeetle2,hRMSPedSubBeetle2NoSig,hRMSPedSubBeetle2NoSig2,legRMSBeetle2,alg_path_to_figures); + + DrawHist(cchTailBeetle1,hchTailBeetle1,"E",alg_path_to_figures); + DrawHist(cchTailBeetle2,hchTailBeetle2,"E",alg_path_to_figures); + + DrawHist(cevTailBeetle1,hevTailBeetle1,"E",alg_path_to_figures); + DrawHist(cevTailBeetle2,hevTailBeetle2,"E",alg_path_to_figures); + + output->cd(); + + // Close input ROOT file. + input->Close(); + + return; +} + +#endif diff --git a/Software/ComputeCMN/CMNSubMeanOddEven.C b/Software/ComputeCMN/CMNSubMeanOddEven.C new file mode 100644 index 0000000..e9f6872 --- /dev/null +++ b/Software/ComputeCMN/CMNSubMeanOddEven.C @@ -0,0 +1,608 @@ +//************************************************ +// Author: Federica Lionetto +// Created on: 10/12/2014 +//************************************************ + +/* +CMNSubMeanOddEven is one of the CMN subtraction algorithms. + +For odd and for even Beetle channels, separately. +Pedestal subtracted ADC counts ---> Calculate mean and rms ---> Exclude signal (requiring |ADC-mean| Calculate mean and rms ---> Exclude signal (requiring |ADC-mean| Calculate mean ---> Subtract mean ---> Pedestal and CMN subtracted ADC counts. + +It loops over events, creates the event-by-event distribution of the pedestal subtracted ADC counts (hADCPedSubBeetlexOdd_1evt and hADCPedSubBeetlexEven_1evt), calculates the mean and the rms, ignores strips that may potentially contain a signal and creates the event-by-event distribution of the pedestal subtracted ADC counts (hADCPedSubBeetlexOddNoSig_1evt and hADCPedSubBeetlexEvenNoSig_1evt), calculates the mean and the rms, ignores strips that may potentially contain a signal and creates the event-by-event distribution of the pedestal subtracted ADC counts (hADCPedSubBeetlexOddNoSig2_1evt and hADCPedSubBeetlexEvenNoSig2_1evt), calculates the average, subtracts it to every strip, and creates the event-by-event distribution of the pedestal and CMN subtracted ADC counts (hADCPedCMNSubBeetlexOdd_1evt and hADCPedCMNSubBeetlexEven_1evt). +If there is no common mode noise, the pedestal and the pedestal and CMN versions will look the same. + +It creates the distribution of the CMN (hCMNBeetlexOdd and hCMNBeetlexEven). + +It creates the distribution of the pedestal subtracted ADC counts (hADCPedSubBeetlex) and the distribution of the pedestal and CMN subtracted ADC counts (hADCPedCMNSubBeetlex), comparing the two. + +It creates the distribution of the RMS of the ADC count distribution for the following cases: +- pedestal subtracted ADC counts; +- pedestal subtracted ADC counts, after the first outlier removal; +- pedestal subtracted ADC counts, after the second outlier removal. + +In beam off data the ADC count distribution after CMN subtraction is not symmetric. +This might be explained by muons coming from the beam line and acting as "signal". +To check this hypothesis, it is interesting to look at the distribution of the Beetle channels contributing to the tail on the right (TH1F *hchTailBeetlex) and the distribution of the event numbers where this happens (TH1F *hevTailBeetlex). + +The configuration of the CMN algorithm is defined by factor. +The other arguments are: +- the number of one event to display, to check that the algorithm is working properly; +- the string corresponding to the input ROOT file, where to get the pedestal subtracted ADC counts from; +- the pointer to the output ROOT file, where to save the output of this algorithm; +- the string corresponding to the path where to save the pictures. + +CMNSubMeanOddEven will create a directory in the output ROOT file called "CMNSubMeanOddEven", where the tree (with CMN1Odd, CMN1Even, CMN2Odd, CMN2Even, and ADCPedCMNSub) and the histograms, graphs, and canvases will be stored. +*/ + +// Header guard. +#ifndef __CMNSUBMEANODDEVEN_C_INCLUDED__ +#define __CMNSUBMEANODDEVEN_C_INCLUDED__ + +void CMNSubMeanOddEven(float factor, int sample, string input_ROOT, TFile *output, TString path_to_figures); + +void CMNSubMeanOddEven(float factor, int sample, string input_ROOT, TFile *output, TString path_to_figures) +{ + cout << "**************************************************" << endl; + cout << "Computing CMN according to the mean odd/even algorithm..." << endl; + cout << "**************************************************" << endl; + + cout << "**************************************************" << endl; + cout << "Configuration" << endl; + cout << "factor: " << factor << endl; + cout << "sample: " << sample << endl; + cout << "**************************************************" << endl; + + // Open input ROOT file. + cout << "Open input ROOT file: " << input_ROOT << endl; + TFile *input = TFile::Open(TString(input_ROOT)); + + input->cd(); + TTree *EventInfo = (TTree *)input->Get("EventInfo"); + int NEvents = EventInfo->GetEntries(); + + TString dirCMNSubMeanOddEven = "CMNSubMeanOddEven"; + output->cd(); + output->mkdir(dirCMNSubMeanOddEven); + output->cd(dirCMNSubMeanOddEven); + + TString alg_path_to_figures = path_to_figures+dirCMNSubMeanOddEven; + TString alg_path_to_make_figures = "mkdir -p "+alg_path_to_figures; + system(alg_path_to_make_figures.Data()); + + // Copy the EventInfo tree from the input to the output file and add some more information. + float CMN1Odd = 0.; + float CMN1Even = 0.; + float CMN2Odd = 0.; + float CMN2Even = 0.; + std::vector ADCPedCMNSub; // Raw ADC - pedestal - CMN. + + TTree *EventInfoProcessed = EventInfo->CloneTree(0); + std::vector *ADCProcessed = 0; + TBranch *b_ADCProcessed = 0; + EventInfo->SetBranchAddress("ADCProcessed",&ADCProcessed,&b_ADCProcessed); + EventInfoProcessed->Branch("CMN1Odd",&CMN1Odd); + EventInfoProcessed->Branch("CMN1Even",&CMN1Even); + EventInfoProcessed->Branch("CMN2Odd",&CMN2Odd); + EventInfoProcessed->Branch("CMN2Even",&CMN2Even); + EventInfoProcessed->Branch("ADCPedCMNSub",&ADCPedCMNSub); + + // Event-by-event histograms. + + // Event-by-event distribution of the pedestal subtracted ADC counts (hADCPedSubBeetlexOdd_1evt and hADCPedSubBeetlexEven_1evt). + + // Odd Beetle channels. + TH1F *hADCPedSubBeetle1Odd_1evt = new TH1F("hADCPedSubBeetle1Odd_1evt","",400,-200,200); // Modify it. + TCanvas *cADCPedSubBeetle1Odd_1evt = new TCanvas("cADCPedSubBeetle1Odd_1evt","",400,300); + InitHist(hADCPedSubBeetle1Odd_1evt,"Pedestal subtracted ADC counts on odd channels of Beetle 1","ADC counts",""); + + TH1F *hADCPedSubBeetle2Odd_1evt = new TH1F("hADCPedSubBeetle2Odd_1evt","",400,-200,200); //Modify it. + TCanvas *cADCPedSubBeetle2Odd_1evt = new TCanvas("cADCPedSubBeetle2Odd_1evt","",400,300); + InitHist(hADCPedSubBeetle2Odd_1evt,"Pedestal subtracted ADC counts on odd channels of Beetle 2","ADC counts",""); + + // Even Beetle channels. + TH1F *hADCPedSubBeetle1Even_1evt = new TH1F("hADCPedSubBeetle1Even_1evt","",400,-200,200); // Modify it. + TCanvas *cADCPedSubBeetle1Even_1evt = new TCanvas("cADCPedSubBeetle1Even_1evt","",400,300); + InitHist(hADCPedSubBeetle1Even_1evt,"Pedestal subtracted ADC counts on even channels of Beetle 1","ADC counts",""); + + TH1F *hADCPedSubBeetle2Even_1evt = new TH1F("hADCPedSubBeetle2Even_1evt","",400,-200,200); //Modify it. + TCanvas *cADCPedSubBeetle2Even_1evt = new TCanvas("cADCPedSubBeetle2Even_1evt","",400,300); + InitHist(hADCPedSubBeetle2Even_1evt,"Pedestal subtracted ADC counts on even channels of Beetle 2","ADC counts",""); + + // Ignore strips that may potentially contain a signal. + // Event-by-event distribution of the pedestal subtracted ADC counts (hADCPedSubBeetlexOddNoSig_1evt and hADCPedSubBeetlexEvenNoSig_1evt). + + // First iteration. + + // Odd Beetle channels. + TH1F *hADCPedSubBeetle1OddNoSig_1evt = new TH1F("hADCPedSubBeetle1OddNoSig_1evt","",400,-200,200); // Modify it. + TCanvas *cADCPedSubBeetle1OddNoSig_1evt = new TCanvas("cADCPedSubBeetle1OddNoSig_1evt","",400,300); + InitHist(hADCPedSubBeetle1OddNoSig_1evt,"Pedestal subtracted ADC counts on odd channels of Beetle 1 - excluding signal","ADC counts",""); + + TH1F *hADCPedSubBeetle2OddNoSig_1evt = new TH1F("hADCPedSubBeetle2OddNoSig_1evt","",400,-200,200); //Modify it. + TCanvas *cADCPedSubBeetle2OddNoSig_1evt = new TCanvas("cADCPedSubBeetle2OddNoSig_1evt","",400,300); + InitHist(hADCPedSubBeetle2OddNoSig_1evt,"Pedestal subtracted ADC counts on odd channels of Beetle 2 - excluding signal","ADC counts",""); + + // Even Beetle channels. + TH1F *hADCPedSubBeetle1EvenNoSig_1evt = new TH1F("hADCPedSubBeetle1EvenNoSig_1evt","",400,-200,200); // Modify it. + TCanvas *cADCPedSubBeetle1EvenNoSig_1evt = new TCanvas("cADCPedSubBeetle1EvenNoSig_1evt","",400,300); + InitHist(hADCPedSubBeetle1EvenNoSig_1evt,"Pedestal subtracted ADC counts on even channels of Beetle 1 - excluding signal","ADC counts",""); + + TH1F *hADCPedSubBeetle2EvenNoSig_1evt = new TH1F("hADCPedSubBeetle2EvenNoSig_1evt","",400,-200,200); //Modify it. + TCanvas *cADCPedSubBeetle2EvenNoSig_1evt = new TCanvas("cADCPedSubBeetle2EvenNoSig_1evt","",400,300); + InitHist(hADCPedSubBeetle2EvenNoSig_1evt,"Pedestal subtracted ADC counts on even channels of Beetle 2 - excluding signal","ADC counts",""); + + // Second iteration. + + // Odd Beetle channels. + TH1F *hADCPedSubBeetle1OddNoSig2_1evt = new TH1F("hADCPedSubBeetle1OddNoSig2_1evt","",400,-200,200); // Modify it. + TCanvas *cADCPedSubBeetle1OddNoSig2_1evt = new TCanvas("cADCPedSubBeetle1OddNoSig2_1evt","",400,300); + InitHist(hADCPedSubBeetle1OddNoSig2_1evt,"Pedestal subtracted ADC counts on odd channels of Beetle 1 - excluding signal","ADC counts",""); + + TH1F *hADCPedSubBeetle2OddNoSig2_1evt = new TH1F("hADCPedSubBeetle2OddNoSig2_1evt","",400,-200,200); //Modify it. + TCanvas *cADCPedSubBeetle2OddNoSig2_1evt = new TCanvas("cADCPedSubBeetle2OddNoSig2_1evt","",400,300); + InitHist(hADCPedSubBeetle2OddNoSig2_1evt,"Pedestal subtracted ADC counts on odd channels of Beetle 2 - excluding signal","ADC counts",""); + + // Even Beetle channels. + TH1F *hADCPedSubBeetle1EvenNoSig2_1evt = new TH1F("hADCPedSubBeetle1EvenNoSig2_1evt","",400,-200,200); // Modify it. + TCanvas *cADCPedSubBeetle1EvenNoSig2_1evt = new TCanvas("cADCPedSubBeetle1EvenNoSig2_1evt","",400,300); + InitHist(hADCPedSubBeetle1EvenNoSig2_1evt,"Pedestal subtracted ADC counts on even channels of Beetle 1 - excluding signal","ADC counts",""); + + TH1F *hADCPedSubBeetle2EvenNoSig2_1evt = new TH1F("hADCPedSubBeetle2EvenNoSig2_1evt","",400,-200,200); //Modify it. + TCanvas *cADCPedSubBeetle2EvenNoSig2_1evt = new TCanvas("cADCPedSubBeetle2EvenNoSig2_1evt","",400,300); + InitHist(hADCPedSubBeetle2EvenNoSig2_1evt,"Pedestal subtracted ADC counts on even channels of Beetle 2 - excluding signal","ADC counts",""); + + // Event-by-event distribution of the pedestal and CMN subtracted ADC counts (hADCPedCMNSubBeetlexOdd_1evt and hADCPedCMNSubBeetlexEven_1evt). + + // Odd Beetle channels. + TH1F *hADCPedCMNSubBeetle1Odd_1evt = new TH1F("hADCPedCMNSubBeetle1Odd_1evt","",400,-200,200); // Modify it. + TCanvas *cADCPedCMNSubBeetle1Odd_1evt = new TCanvas("cADCPedCMNSubBeetle1Odd_1evt","",400,300); + InitHist(hADCPedCMNSubBeetle1Odd_1evt,"Pedestal and CMN subtracted ADC counts on odd channels of Beetle 1","ADC counts",""); + + TH1F *hADCPedCMNSubBeetle2Odd_1evt = new TH1F("hADCPedCMNSubBeetle2Odd_1evt","",400,-200,200); //Modify it. + TCanvas *cADCPedCMNSubBeetle2Odd_1evt = new TCanvas("cADCPedCMNSubBeetle2Odd_1evt","",400,300); + InitHist(hADCPedCMNSubBeetle2Odd_1evt,"Pedestal and CMN subtracted ADC counts on odd channels of Beetle 2","ADC counts",""); + + // Even Beetle channels. + TH1F *hADCPedCMNSubBeetle1Even_1evt = new TH1F("hADCPedCMNSubBeetle1Even_1evt","",400,-200,200); // Modify it. + TCanvas *cADCPedCMNSubBeetle1Even_1evt = new TCanvas("cADCPedCMNSubBeetle1Even_1evt","",400,300); + InitHist(hADCPedCMNSubBeetle1Even_1evt,"Pedestal and CMN subtracted ADC counts on even channels of Beetle 1","ADC counts",""); + + TH1F *hADCPedCMNSubBeetle2Even_1evt = new TH1F("hADCPedCMNSubBeetle2Even_1evt","",400,-200,200); //Modify it. + TCanvas *cADCPedCMNSubBeetle2Even_1evt = new TCanvas("cADCPedCMNSubBeetle2Even_1evt","",400,300); + InitHist(hADCPedCMNSubBeetle2Even_1evt,"Pedestal and CMN subtracted ADC counts on even channels of Beetle 2","ADC counts",""); + + // Histograms containing the information on all events. + + // CMN1. + + // Odd Beetle channels. + TH1F *hCMNBeetle1Odd = new TH1F("hCMNBeetle1Odd","",100,-50,50); // Modify it. + TCanvas *cCMNBeetle1Odd = new TCanvas("cCMNBeetle1Odd","",400,300); + InitHist(hCMNBeetle1Odd,"CMN on odd channels of Beetle 1","ADC counts",""); + + // Even Beetle channels. + TH1F *hCMNBeetle1Even = new TH1F("hCMNBeetle1Even","",100,-50,50); // Modify it. + TCanvas *cCMNBeetle1Even = new TCanvas("cCMNBeetle1Even","",400,300); + InitHist(hCMNBeetle1Even,"CMN on even channels of Beetle 1","ADC counts",""); + + // CMN2. + + // Odd Beetle channels. + TH1F *hCMNBeetle2Odd = new TH1F("hCMNBeetle2Odd","",100,-50,50); // Modify it. + TCanvas *cCMNBeetle2Odd = new TCanvas("cCMNBeetle2Odd","",400,300); + InitHist(hCMNBeetle2Odd,"CMN on odd channels of Beetle 2","ADC counts",""); + + // Even Beetle channels. + TH1F *hCMNBeetle2Even = new TH1F("hCMNBeetle2Even","",100,-50,50); // Modify it. + TCanvas *cCMNBeetle2Even = new TCanvas("cCMNBeetle2Even","",400,300); + InitHist(hCMNBeetle2Even,"CMN on even channels of Beetle 2","ADC counts",""); + + // Distribution of the pedestal subtracted ADC counts (hADCPedSubBeetlex). + TH1F *hADCPedSubBeetle1 = new TH1F("hADCPedSubBeetle1","",400,-200,200); + InitHist(hADCPedSubBeetle1,"Pedestal subtracted ADC counts on Beetle 1","ADC counts",""); + TH1F *hADCPedSubBeetle2 = new TH1F("hADCPedSubBeetle2","",400,-200,200); + InitHist(hADCPedSubBeetle2,"Pedestal subtracted ADC counts on Beetle 2","ADC counts",""); + + // Distribution of the pedestal and CMN subtracted ADC counts (hADCPedCMNSubBeetlex). + TH1F *hADCPedCMNSubBeetle1 = new TH1F("hADCPedCMNSubBeetle1","",400,-200,200); + InitHist(hADCPedCMNSubBeetle1,"Pedestal and CMN subtracted ADC counts on Beetle 1","ADC counts",""); + TH1F *hADCPedCMNSubBeetle2 = new TH1F("hADCPedCMNSubBeetle2","",400,-200,200); + InitHist(hADCPedCMNSubBeetle2,"Pedestal and CMN subtracted ADC counts on Beetle 2","ADC counts",""); + + TCanvas *cADCCompBeetle1 = new TCanvas("cADCCompBeetle1","",400,300); + TCanvas *cADCCompBeetle2 = new TCanvas("cADCCompBeetle2","",400,300); + + // Distribution of the RMS of the ADC count distribution for the following cases: + // - pedestal subtracted ADC counts; + // - pedestal subtracted ADC counts, after the first outlier removal; + // - pedestal subtracted ADC counts, after the second outlier removal. + TH1F *hRMSPedSubBeetle1 = new TH1F("hRMSPedSubBeetle1","",90,0,30); + TH1F *hRMSPedSubBeetle1NoSig = new TH1F("hRMSPedSubBeetle1NoSig","",90,0,30); + TH1F *hRMSPedSubBeetle1NoSig2 = new TH1F("hRMSPedSubBeetle1NoSig2","",90,0,30); + TH1F *hRMSPedSubBeetle2 = new TH1F("hRMSPedSubBeetle2","",90,0,30); + TH1F *hRMSPedSubBeetle2NoSig = new TH1F("hRMSPedSubBeetle2NoSig","",90,0,30); + TH1F *hRMSPedSubBeetle2NoSig2 = new TH1F("hRMSPedSubBeetle2NoSig2","",90,0,30); + + InitHist(hRMSPedSubBeetle1,"RMS of pedestal subtracted ADC counts on Beetle 1","RMS (ADC counts)",""); + InitHist(hRMSPedSubBeetle1NoSig,"RMS of pedestal subtracted ADC counts on Beetle 1","RMS (ADC counts)",""); + InitHist(hRMSPedSubBeetle1NoSig2,"RMS of pedestal subtracted ADC counts on Beetle 1","RMS (ADC counts)",""); + InitHist(hRMSPedSubBeetle2,"RMS of pedestal subtracted ADC counts on Beetle 2","RMS (ADC counts)",""); + InitHist(hRMSPedSubBeetle2NoSig,"RMS of pedestal subtracted ADC counts on Beetle 2","RMS (ADC counts)",""); + InitHist(hRMSPedSubBeetle2NoSig2,"RMS of pedestal subtracted ADC counts on Beetle 2","RMS (ADC counts)",""); + + TCanvas *cRMSBeetle1 = new TCanvas("cRMSBeetle1","",400,300); + TCanvas *cRMSBeetle2 = new TCanvas("cRMSBeetle2","",400,300); + + // In beam off data the ADC count distribution after CMN subtraction is not symmetric. + // This might be explained by muons coming from the beam line and acting as "signal". + // To check this hypothesis, it is interesting to look at the distribution of the Beetle channels contributing to the tail on the right (TH1F *hchTailBeetlex) and the distribution of the event numbers where this happens (TH1F *hevTailBeetlex). + TH1F *hchTailBeetle1 = new TH1F("hcdTailBeetle1","",NBeetle,0,NBeetle); + TH1F *hchTailBeetle2 = new TH1F("hcdTailBeetle2","",NBeetle,NBeetle,N); + + InitHist(hchTailBeetle1,"Asymmetric tail on Beetle 1","Beetle channel",""); + InitHist(hchTailBeetle2,"Asymmetric tail on Beetle 2","Beetle channel",""); + + TCanvas *cchTailBeetle1 = new TCanvas("cchTailBeetle1","",400,300); + TCanvas *cchTailBeetle2 = new TCanvas("cchTailBeetle2","",400,300); + + TH1F *hevTailBeetle1 = new TH1F("hevTailBeetle1","",50,0,NEvents+1); + TH1F *hevTailBeetle2 = new TH1F("hevTailBeetle2","",50,0,NEvents+1); + + InitHist(hevTailBeetle1,"Asymmetric tail on Beetle 1","Event number",""); + InitHist(hevTailBeetle2,"Asymmetric tail on Beetle 2","Event number",""); + + TCanvas *cevTailBeetle1 = new TCanvas("cevTailBeetle1","",400,300); + TCanvas *cevTailBeetle2 = new TCanvas("cevTailBeetle2","",400,300); + + // Add the histograms with the pedestal and CMN subtracted distribution of the ADC counts of each Beetle channel (TH1F *hADCPedCMNSub[N]) to the output file. + TH1F *hADCPedCMNSub[N]; + for (int iChannel=0;iChannel0) + { + ADCPedCMNSub.clear(); + + hADCPedSubBeetle1Odd_1evt->Reset(); + hADCPedSubBeetle2Odd_1evt->Reset(); + hADCPedSubBeetle1OddNoSig_1evt->Reset(); + hADCPedSubBeetle2OddNoSig_1evt->Reset(); + hADCPedSubBeetle1OddNoSig2_1evt->Reset(); + hADCPedSubBeetle2OddNoSig2_1evt->Reset(); + hADCPedCMNSubBeetle1Odd_1evt->Reset(); + hADCPedCMNSubBeetle2Odd_1evt->Reset(); + + hADCPedSubBeetle1Even_1evt->Reset(); + hADCPedSubBeetle2Even_1evt->Reset(); + hADCPedSubBeetle1EvenNoSig_1evt->Reset(); + hADCPedSubBeetle2EvenNoSig_1evt->Reset(); + hADCPedSubBeetle1EvenNoSig2_1evt->Reset(); + hADCPedSubBeetle2EvenNoSig2_1evt->Reset(); + hADCPedCMNSubBeetle1Even_1evt->Reset(); + hADCPedCMNSubBeetle2Even_1evt->Reset(); + } + + EventInfo->GetEntry(iEvent); + + // Fill histograms for Beetle 1. + for (int iChannel=0;iChannelFill((float)ADCProcessed->at(iChannel)); + if (iChannel%2!=0) + hADCPedSubBeetle1Odd_1evt->Fill((float)ADCProcessed->at(iChannel)); + else + hADCPedSubBeetle1Even_1evt->Fill((float)ADCProcessed->at(iChannel)); + } + } + + // Exclude signal. + meanBeetle1Odd_temp = hADCPedSubBeetle1Odd_1evt->GetMean(); + rmsBeetle1Odd_temp = hADCPedSubBeetle1Odd_1evt->GetRMS(); + + meanBeetle1Even_temp = hADCPedSubBeetle1Even_1evt->GetMean(); + rmsBeetle1Even_temp = hADCPedSubBeetle1Even_1evt->GetRMS(); + + hRMSPedSubBeetle1->Fill(rmsBeetle1Odd_temp); + hRMSPedSubBeetle1->Fill(rmsBeetle1Even_temp); + + // Fill histograms again for Beetle 1. + for (int iChannel=0;iChannelat(iChannel)-meanBeetle1Odd_temp)Fill((float)ADCProcessed->at(iChannel)); + } + else + { + if (abs((float)ADCProcessed->at(iChannel)-meanBeetle1Even_temp)Fill((float)ADCProcessed->at(iChannel)); + } + } + } + + // Exclude signal. + meanBeetle1Odd_temp = hADCPedSubBeetle1OddNoSig_1evt->GetMean(); + rmsBeetle1Odd_temp = hADCPedSubBeetle1OddNoSig_1evt->GetRMS(); + + meanBeetle1Even_temp = hADCPedSubBeetle1EvenNoSig_1evt->GetMean(); + rmsBeetle1Even_temp = hADCPedSubBeetle1EvenNoSig_1evt->GetRMS(); + + hRMSPedSubBeetle1NoSig->Fill(rmsBeetle1Odd_temp); + hRMSPedSubBeetle1NoSig->Fill(rmsBeetle1Even_temp); + + // Fill histograms again for Beetle 1. + for (int iChannel=0;iChannelat(iChannel)-meanBeetle1Odd_temp)Fill((float)ADCProcessed->at(iChannel)); + } + else + { + if (abs((float)ADCProcessed->at(iChannel)-meanBeetle1Even_temp)Fill((float)ADCProcessed->at(iChannel)); + } + } + } + + // Calculate CMN1. + + // Odd Beetle channels. + CMN1Odd = hADCPedSubBeetle1OddNoSig2_1evt->GetMean(); + rmsBeetle1Odd_temp = hADCPedSubBeetle1OddNoSig2_1evt->GetRMS(); + + hRMSPedSubBeetle1NoSig2->Fill(rmsBeetle1Odd_temp); + + hCMNBeetle1Odd->Fill(CMN1Odd); + + // Even Beetle channels. + CMN1Even = hADCPedSubBeetle1EvenNoSig2_1evt->GetMean(); + rmsBeetle1Even_temp = hADCPedSubBeetle1EvenNoSig2_1evt->GetRMS(); + + hRMSPedSubBeetle1NoSig2->Fill(rmsBeetle1Even_temp); + + hCMNBeetle1Even->Fill(CMN1Even); + + // Fill histograms for Beetle 2. + for (int iChannel=NBeetle;iChannelFill((float)ADCProcessed->at(iChannel)); + if (iChannel%2!=0) + hADCPedSubBeetle2Odd_1evt->Fill((float)ADCProcessed->at(iChannel)); + else + hADCPedSubBeetle2Even_1evt->Fill((float)ADCProcessed->at(iChannel)); + } + } + + // Exclude signal. + meanBeetle2Odd_temp = hADCPedSubBeetle2Odd_1evt->GetMean(); + rmsBeetle2Odd_temp = hADCPedSubBeetle2Odd_1evt->GetRMS(); + + meanBeetle2Even_temp = hADCPedSubBeetle2Even_1evt->GetMean(); + rmsBeetle2Even_temp = hADCPedSubBeetle2Even_1evt->GetRMS(); + + hRMSPedSubBeetle2->Fill(rmsBeetle2Odd_temp); + hRMSPedSubBeetle2->Fill(rmsBeetle2Even_temp); + + // Fill histograms again for Beetle 2. + for (int iChannel=NBeetle;iChannelat(iChannel)-meanBeetle2Odd_temp)Fill((float)ADCProcessed->at(iChannel)); + } + else + { + if (abs((float)ADCProcessed->at(iChannel)-meanBeetle2Even_temp)Fill((float)ADCProcessed->at(iChannel)); + } + } + } + + // Exclude signal. + meanBeetle2Odd_temp = hADCPedSubBeetle2OddNoSig_1evt->GetMean(); + rmsBeetle2Odd_temp = hADCPedSubBeetle2OddNoSig_1evt->GetRMS(); + + meanBeetle2Even_temp = hADCPedSubBeetle2EvenNoSig_1evt->GetMean(); + rmsBeetle2Even_temp = hADCPedSubBeetle2EvenNoSig_1evt->GetRMS(); + + hRMSPedSubBeetle2NoSig->Fill(rmsBeetle2Odd_temp); + hRMSPedSubBeetle2NoSig->Fill(rmsBeetle2Even_temp); + + // Fill histograms again for Beetle 2. + for (int iChannel=NBeetle;iChannelat(iChannel)-meanBeetle2Odd_temp)Fill((float)ADCProcessed->at(iChannel)); + } + else + { + if (abs((float)ADCProcessed->at(iChannel)-meanBeetle2Even_temp)Fill((float)ADCProcessed->at(iChannel)); + } + } + } + + // Calculate CMN2. + + // Odd Beetle channels. + CMN2Odd = hADCPedSubBeetle2OddNoSig2_1evt->GetMean(); + rmsBeetle2Odd_temp = hADCPedSubBeetle2OddNoSig2_1evt->GetRMS(); + + hRMSPedSubBeetle2NoSig2->Fill(rmsBeetle2Odd_temp); + + hCMNBeetle2Odd->Fill(CMN2Odd); + + // Even Beetle channels. + CMN2Even = hADCPedSubBeetle2EvenNoSig2_1evt->GetMean(); + rmsBeetle2Even_temp = hADCPedSubBeetle2EvenNoSig2_1evt->GetRMS(); + + hRMSPedSubBeetle2NoSig2->Fill(rmsBeetle2Even_temp); + + hCMNBeetle2Even->Fill(CMN2Even); + + // Subtract CMN1. + for (int iChannel=0;iChannelat(iChannel)-CMN1Odd); + hADCPedCMNSub[iChannel]->Fill((float)ADCProcessed->at(iChannel)-CMN1Odd); + } + else + { + ADCPedCMNSub.push_back((float)ADCProcessed->at(iChannel)-CMN1Even); + hADCPedCMNSub[iChannel]->Fill((float)ADCProcessed->at(iChannel)-CMN1Even); + } + if (maskBeetle1[iChannel] == 0) + { + if (iChannel%2!=0) + { + hADCPedCMNSubBeetle1->Fill((float)ADCProcessed->at(iChannel)-CMN1Odd); + hADCPedCMNSubBeetle1Odd_1evt->Fill((float)ADCProcessed->at(iChannel)-CMN1Odd); + } + else + { + hADCPedCMNSubBeetle1->Fill((float)ADCProcessed->at(iChannel)-CMN1Even); + hADCPedCMNSubBeetle1Even_1evt->Fill((float)ADCProcessed->at(iChannel)-CMN1Even); + } + if (((((float)ADCProcessed->at(iChannel)-CMN1Odd) > 30.) && (iChannel%2!=0)) || ((((float)ADCProcessed->at(iChannel)-CMN1Even) > 30.) && (iChannel%2==0))) + { + cout << "The event #" << iEvent << " has at least one Beetle channels (" << iChannel << ") contributing to the tail" << endl; + hchTailBeetle1->Fill(iChannel); + hevTailBeetle1->Fill(iEvent); + } + } + } + + // Subtract CMN2. + for (int iChannel=NBeetle;iChannelat(iChannel)-CMN2Odd); + hADCPedCMNSub[iChannel]->Fill((float)ADCProcessed->at(iChannel)-CMN2Odd); + } + else + { + ADCPedCMNSub.push_back((float)ADCProcessed->at(iChannel)-CMN2Even); + hADCPedCMNSub[iChannel]->Fill((float)ADCProcessed->at(iChannel)-CMN2Even); + } + if (maskBeetle2[iChannel-NBeetle] == 0) + { + if (iChannel%2!=0) + { + hADCPedCMNSubBeetle2->Fill((float)ADCProcessed->at(iChannel)-CMN2Odd); + hADCPedCMNSubBeetle2Odd_1evt->Fill((float)ADCProcessed->at(iChannel)-CMN2Odd); + } + else + { + hADCPedCMNSubBeetle2->Fill((float)ADCProcessed->at(iChannel)-CMN2Even); + hADCPedCMNSubBeetle2Even_1evt->Fill((float)ADCProcessed->at(iChannel)-CMN2Even); + } + + if (((((float)ADCProcessed->at(iChannel)-CMN2Odd) > 30.) && (iChannel%2!=0)) || ((((float)ADCProcessed->at(iChannel)-CMN2Even) > 30.) && (iChannel%2==0))) + { + cout << "The event #" << iEvent << " has at least one Beetle channels (" << iChannel << ") contributing to the tail" << endl; + hchTailBeetle2->Fill(iChannel); + hevTailBeetle2->Fill(iEvent); + } + } + } + + EventInfoProcessed->Fill(); + + if (iEvent==sample) { + // Odd Beetle channels. + DrawHist(cADCPedSubBeetle1Odd_1evt,hADCPedSubBeetle1Odd_1evt,"",alg_path_to_figures); + DrawHist(cADCPedSubBeetle2Odd_1evt,hADCPedSubBeetle2Odd_1evt,"",alg_path_to_figures); + DrawHist(cADCPedSubBeetle1OddNoSig_1evt,hADCPedSubBeetle1OddNoSig_1evt,"",alg_path_to_figures); + DrawHist(cADCPedSubBeetle2OddNoSig_1evt,hADCPedSubBeetle2OddNoSig_1evt,"",alg_path_to_figures); + DrawHist(cADCPedSubBeetle1OddNoSig2_1evt,hADCPedSubBeetle1OddNoSig2_1evt,"",alg_path_to_figures); + DrawHist(cADCPedSubBeetle2OddNoSig2_1evt,hADCPedSubBeetle2OddNoSig2_1evt,"",alg_path_to_figures); + DrawHist(cADCPedCMNSubBeetle1Odd_1evt,hADCPedCMNSubBeetle1Odd_1evt,"",alg_path_to_figures); + DrawHist(cADCPedCMNSubBeetle2Odd_1evt,hADCPedCMNSubBeetle2Odd_1evt,"",alg_path_to_figures); + + // Even Beetle channels. + DrawHist(cADCPedSubBeetle1Even_1evt,hADCPedSubBeetle1Even_1evt,"",alg_path_to_figures); + DrawHist(cADCPedSubBeetle2Even_1evt,hADCPedSubBeetle2Even_1evt,"",alg_path_to_figures); + DrawHist(cADCPedSubBeetle1EvenNoSig_1evt,hADCPedSubBeetle1EvenNoSig_1evt,"",alg_path_to_figures); + DrawHist(cADCPedSubBeetle2EvenNoSig_1evt,hADCPedSubBeetle2EvenNoSig_1evt,"",alg_path_to_figures); + DrawHist(cADCPedSubBeetle1EvenNoSig2_1evt,hADCPedSubBeetle1EvenNoSig2_1evt,"",alg_path_to_figures); + DrawHist(cADCPedSubBeetle2EvenNoSig2_1evt,hADCPedSubBeetle2EvenNoSig2_1evt,"",alg_path_to_figures); + DrawHist(cADCPedCMNSubBeetle1Even_1evt,hADCPedCMNSubBeetle1Even_1evt,"",alg_path_to_figures); + DrawHist(cADCPedCMNSubBeetle2Even_1evt,hADCPedCMNSubBeetle2Even_1evt,"",alg_path_to_figures); + } + + } + + // Odd Beetle channels. + DrawHist(cCMNBeetle1Odd,hCMNBeetle1Odd,"",alg_path_to_figures); + DrawHist(cCMNBeetle2Odd,hCMNBeetle2Odd,"",alg_path_to_figures); + + // Even Beetle channels. + DrawHist(cCMNBeetle1Even,hCMNBeetle1Even,"",alg_path_to_figures); + DrawHist(cCMNBeetle2Even,hCMNBeetle2Even,"",alg_path_to_figures); + + TLegend *legADCCompBeetle1 = CreateLegend2(hADCPedSubBeetle1,"ped sub",hADCPedCMNSubBeetle1,"ped + CMN sub"); + TLegend *legADCCompBeetle2 = CreateLegend2(hADCPedSubBeetle2,"ped sub",hADCPedCMNSubBeetle2,"ped + CMN sub"); + + cADCCompBeetle1->SetLogy(); + cADCCompBeetle2->SetLogy(); + + DrawHistCompare(cADCCompBeetle1,hADCPedSubBeetle1,hADCPedCMNSubBeetle1,legADCCompBeetle1,alg_path_to_figures); + DrawHistCompare(cADCCompBeetle2,hADCPedSubBeetle2,hADCPedCMNSubBeetle2,legADCCompBeetle2,alg_path_to_figures); + + TLegend *legRMSBeetle1 = CreateLegend3(hRMSPedSubBeetle1,"ped sub",hRMSPedSubBeetle1NoSig,"after 1st outlier removal",hRMSPedSubBeetle1NoSig2,"after 2nd outlier removal","lpfw",0.42,0.59,0.94,0.89); + TLegend *legRMSBeetle2 = CreateLegend3(hRMSPedSubBeetle2,"ped sub",hRMSPedSubBeetle2NoSig,"after 1st outlier removal",hRMSPedSubBeetle2NoSig2,"after 2nd outlier removal","lpfw",0.42,0.59,0.94,0.89); + + DrawHistCompare3(cRMSBeetle1,hRMSPedSubBeetle1,hRMSPedSubBeetle1NoSig,hRMSPedSubBeetle1NoSig2,legRMSBeetle1,alg_path_to_figures); + DrawHistCompare3(cRMSBeetle2,hRMSPedSubBeetle2,hRMSPedSubBeetle2NoSig,hRMSPedSubBeetle2NoSig2,legRMSBeetle2,alg_path_to_figures); + + DrawHist(cchTailBeetle1,hchTailBeetle1,"E",alg_path_to_figures); + DrawHist(cchTailBeetle2,hchTailBeetle2,"E",alg_path_to_figures); + + DrawHist(cevTailBeetle1,hevTailBeetle1,"E",alg_path_to_figures); + DrawHist(cevTailBeetle2,hevTailBeetle2,"E",alg_path_to_figures); + + output->cd(); + + // Close input ROOT file. + input->Close(); + + return; +} + +#endif diff --git a/Software/ComputeCMN/CMNSubMeanxStrips.C b/Software/ComputeCMN/CMNSubMeanxStrips.C new file mode 100644 index 0000000..7d63ae2 --- /dev/null +++ b/Software/ComputeCMN/CMNSubMeanxStrips.C @@ -0,0 +1,525 @@ +//************************************************ +// Author: Federica Lionetto +// Created on: 11/12/2014 +//************************************************ + +/* +CMNSubMeanxStrips is one of the CMN subtraction algorithms. + +For each group of Beetle channels, separately. +Pedestal subtracted ADC counts ---> Calculate mean and rms ---> Exclude signal (requiring |ADC-mean| Calculate mean and rms ---> Exclude signal (requiring |ADC-mean| Calculate mean ---> Subtract mean ---> Pedestal and CMN subtracted ADC counts. +Instead of considering all the Beetle channels together, split them in groups of x Beetle channels each: +- number of groups = NBeetle/x; +- first group = {0,...,x-1}; +- second group = {x,...,2x-1}; +- ... +- in general, i-group = {i*x,...,(i+1)*x-1}. + +First part: +- for each event, calculate CMNx_y, with x={1,2} and y={0,...,number of groups} and put this information in the tree; +- for each event, calculate ADCPedCMNSub and put this information in the tree. + +Second part: +- use the information in the tree to create the histograms and graphs and save them. + +CMNSubMeanxStrips will create a directory in the output ROOT file called "CMNSubMeanxStrips", where the tree and the histograms, graphs, and canvases will be stored. +*/ + +// Header guard. +#ifndef __CMNSUBMEANXSTRIPS_C_INCLUDED__ +#define __CMNSUBMEANXSTRIPS_C_INCLUDED__ + + +void CMNSubMeanxStrips(float x, float factor, int sample, string input_ROOT, TFile *output, TString path_to_figures); + +void CMNSubMeanxStrips(float x, float factor, int sample, string input_ROOT, TFile *output, TString path_to_figures) +{ + if (x==0) + { + cout << "Error! The number of Beetle channels per group is zero. The CMNSubMeanxStrips algorithm will not be executed." << endl; + return; + } + if (NBeetle%(int)x!=0) + { + cout << "Error! The number of Beetle channels per group is not a divisor of the total number of Beetle channels. The CMNSubMeanxStrips algorithm will not be executed." << endl; + return; + } + + cout << "**************************************************" << endl; + cout << "Computing CMN according to the x strips algorithm..." << endl; + cout << "**************************************************" << endl; + + cout << "**************************************************" << endl; + cout << "Configuration" << endl; + cout << "x: " << x << endl; + cout << "factor: " << factor << endl; + cout << "sample: " << sample << endl; + cout << "**************************************************" << endl; + + // Open input ROOT file. + cout << "Open input ROOT file: " << input_ROOT << endl; + TFile *input = TFile::Open(TString(input_ROOT)); + + input->cd(); + TTree *EventInfo = (TTree *)input->Get("EventInfo"); + int NEvents = EventInfo->GetEntries(); + + char x_char[10]; + sprintf(x_char,"%d",(int)x); + // cout << x_char << endl; + TString dirCMNSubMeanxStrips = "CMNSubMean"+TString(x_char)+"Strips"; + // cout << dirCMNSubMeanxStrips << endl; + output->cd(); + output->mkdir(dirCMNSubMeanxStrips); + output->cd(dirCMNSubMeanxStrips); + + TString alg_path_to_figures = path_to_figures+dirCMNSubMeanxStrips; + TString alg_path_to_make_figures = "mkdir -p "+alg_path_to_figures; + system(alg_path_to_make_figures.Data()); + + int groups = NBeetle/x; + cout << "The CMN will be determined on " << groups << " groups of Beetle channels." << endl; + + // Copy the EventInfo tree from the input to the output file and add some more information. + float CMN1[groups]; + float CMN2[groups]; + for (int iGroup=0;iGroup ADCPedCMNSub; // Raw ADC - pedestal - CMN. + + TTree *EventInfoProcessed = EventInfo->CloneTree(0); + std::vector *ADCProcessed = 0; + TBranch *b_ADCProcessed = 0; + EventInfo->SetBranchAddress("ADCProcessed",&ADCProcessed,&b_ADCProcessed); + for (int iGroup=0;iGroupBranch(Form("CMN1_%d",iGroup),&CMN1[iGroup]); + EventInfoProcessed->Branch(Form("CMN2_%d",iGroup),&CMN2[iGroup]); + } + EventInfoProcessed->Branch("ADCPedCMNSub",&ADCPedCMNSub); + + // Event-by-event histograms. + + // Event-by-event distribution of the pedestal subtracted ADC counts (hADCPedSubBeetlex_1evt[groups]). + TH1F *hADCPedSubBeetle1_1evt[groups]; + TCanvas *cADCPedSubBeetle1_1evt[groups]; + + TH1F *hADCPedSubBeetle2_1evt[groups]; + TCanvas *cADCPedSubBeetle2_1evt[groups]; + + for (int iGroup=0;iGroup0) + { + ADCPedCMNSub.clear(); + + for (int iGroup=0;iGroupReset(); + hADCPedSubBeetle2_1evt[iGroup]->Reset(); + hADCPedSubBeetle1NoSig_1evt[iGroup]->Reset(); + hADCPedSubBeetle2NoSig_1evt[iGroup]->Reset(); + hADCPedSubBeetle1NoSig2_1evt[iGroup]->Reset(); + hADCPedSubBeetle2NoSig2_1evt[iGroup]->Reset(); + hADCPedCMNSubBeetle1_1evt[iGroup]->Reset(); + hADCPedCMNSubBeetle2_1evt[iGroup]->Reset(); + } + } + + EventInfo->GetEntry(iEvent); + + // Fill histograms for Beetle 1. + // Beetle channels in i-group = {i*x,...,(i+1)*x-1}. + for (int iChannel=0;iChannelFill((float)ADCProcessed->at(iChannel)); + group = iChannel/(int)x; + // cout << iChannel << ", " << group << endl; + hADCPedSubBeetle1_1evt[group]->Fill((float)ADCProcessed->at(iChannel)); + } + } + + // Exclude signal. + for (int iGroup=0;iGroupGetMean(); + rmsBeetle1_temp[iGroup] = hADCPedSubBeetle1_1evt[iGroup]->GetRMS(); + hRMSPedSubBeetle1->Fill(rmsBeetle1_temp[iGroup]); + } + + // Fill histograms again for Beetle 1. + for (int iChannel=0;iChannelat(iChannel)-meanBeetle1_temp[group])Fill((float)ADCProcessed->at(iChannel)); + } + } + + // Exclude signal. + for (int iGroup=0;iGroupGetMean(); + rmsBeetle1_temp[iGroup] = hADCPedSubBeetle1NoSig_1evt[iGroup]->GetRMS(); + hRMSPedSubBeetle1NoSig->Fill(rmsBeetle1_temp[iGroup]); + } + + // Fill histograms again for Beetle 1. + for (int iChannel=0;iChannelat(iChannel)-meanBeetle1_temp[group])Fill((float)ADCProcessed->at(iChannel)); + } + } + + // Calculate CMN1. + for (int iGroup=0;iGroupGetMean(); + rmsBeetle1_temp[iGroup] = hADCPedSubBeetle1NoSig2_1evt[iGroup]->GetRMS(); + + hRMSPedSubBeetle1NoSig2->Fill(rmsBeetle1_temp[iGroup]); + + hCMNBeetle1[iGroup]->Fill(CMN1[iGroup]); + } + + // Fill histograms for Beetle 2. + // Beetle channels in i-group = {NBeetle+i*x,...,NBeetle+(i+1)*x-1}. + for (int iChannel=NBeetle;iChannelFill((float)ADCProcessed->at(iChannel)); + group = (iChannel-NBeetle)/(int)x; + hADCPedSubBeetle2_1evt[group]->Fill((float)ADCProcessed->at(iChannel)); + } + } + + // Exclude signal. + for (int iGroup=0;iGroupGetMean(); + rmsBeetle2_temp[iGroup] = hADCPedSubBeetle2_1evt[iGroup]->GetRMS(); + hRMSPedSubBeetle2->Fill(rmsBeetle2_temp[iGroup]); + } + + // Fill histograms again for Beetle 2. + for (int iChannel=NBeetle;iChannelat(iChannel)-meanBeetle2_temp[group])Fill((float)ADCProcessed->at(iChannel)); + } + } + + // Exclude signal. + for (int iGroup=0;iGroupGetMean(); + rmsBeetle2_temp[iGroup] = hADCPedSubBeetle2NoSig_1evt[iGroup]->GetRMS(); + hRMSPedSubBeetle2NoSig->Fill(rmsBeetle2_temp[iGroup]); + } + + // Fill histograms again for Beetle 2. + + for (int iChannel=NBeetle;iChannelat(iChannel)-meanBeetle2_temp[group]) << endl; + } + */ + + if (abs((float)ADCProcessed->at(iChannel)-meanBeetle2_temp[group])Fill((float)ADCProcessed->at(iChannel)); + } + } + + + // Calculate CMN2. + for (int iGroup=0;iGroupGetMean(); + rmsBeetle2_temp[iGroup] = hADCPedSubBeetle2NoSig2_1evt[iGroup]->GetRMS(); + + hRMSPedSubBeetle2NoSig2->Fill(rmsBeetle2_temp[iGroup]); + + hCMNBeetle2[iGroup]->Fill(CMN2[iGroup]); + } + + // Subtract CMN1. + for (int iChannel=0;iChannelat(iChannel)-CMN1[group]); + hADCPedCMNSub[iChannel]->Fill((float)ADCProcessed->at(iChannel)-CMN1[group]); + + if (maskBeetle1[iChannel] == 0) + { + hADCPedCMNSubBeetle1->Fill((float)ADCProcessed->at(iChannel)-CMN1[group]); + hADCPedCMNSubBeetle1_1evt[group]->Fill((float)ADCProcessed->at(iChannel)-CMN1[group]); + if (((float)ADCProcessed->at(iChannel)-CMN1[group]) > 30.) + { + cout << "The event #" << iEvent << " has at least one Beetle channels (" << iChannel << ") contributing to the tail" << endl; + hchTailBeetle1->Fill(iChannel); + hevTailBeetle1->Fill(iEvent); + } + } + } + + // Subtract CMN2. + for (int iChannel=NBeetle;iChannelat(iChannel)-CMN2[group]); + hADCPedCMNSub[iChannel]->Fill((float)ADCProcessed->at(iChannel)-CMN2[group]); + + if (maskBeetle2[iChannel-NBeetle] == 0) + { + hADCPedCMNSubBeetle2->Fill((float)ADCProcessed->at(iChannel)-CMN2[group]); + hADCPedCMNSubBeetle2_1evt[group]->Fill((float)ADCProcessed->at(iChannel)-CMN2[group]); + if (((float)ADCProcessed->at(iChannel)-CMN2[group]) > 30.) + { + cout << "The event #" << iEvent << " has at least one Beetle channels (" << iChannel << ") contributing to the tail" << endl; + hchTailBeetle2->Fill(iChannel); + hevTailBeetle2->Fill(iEvent); + } + } + } + + EventInfoProcessed->Fill(); + + if (iEvent==sample) { + for (int iGroup=0;iGroupSetLogy(); + cADCCompBeetle2->SetLogy(); + + DrawHistCompare(cADCCompBeetle1,hADCPedSubBeetle1,hADCPedCMNSubBeetle1,legADCCompBeetle1,alg_path_to_figures); + DrawHistCompare(cADCCompBeetle2,hADCPedSubBeetle2,hADCPedCMNSubBeetle2,legADCCompBeetle2,alg_path_to_figures); + + TLegend *legRMSBeetle1 = CreateLegend3(hRMSPedSubBeetle1,"ped sub",hRMSPedSubBeetle1NoSig,"after 1st outlier removal",hRMSPedSubBeetle1NoSig2,"after 2nd outlier removal","lpfw",0.42,0.59,0.94,0.89); + TLegend *legRMSBeetle2 = CreateLegend3(hRMSPedSubBeetle2,"ped sub",hRMSPedSubBeetle2NoSig,"after 1st outlier removal",hRMSPedSubBeetle2NoSig2,"after 2nd outlier removal","lpfw",0.42,0.59,0.94,0.89); + + DrawHistCompare3(cRMSBeetle1,hRMSPedSubBeetle1,hRMSPedSubBeetle1NoSig,hRMSPedSubBeetle1NoSig2,legRMSBeetle1,alg_path_to_figures); + DrawHistCompare3(cRMSBeetle2,hRMSPedSubBeetle2,hRMSPedSubBeetle2NoSig,hRMSPedSubBeetle2NoSig2,legRMSBeetle2,alg_path_to_figures); + + DrawHist(cchTailBeetle1,hchTailBeetle1,"E",alg_path_to_figures); + DrawHist(cchTailBeetle2,hchTailBeetle2,"E",alg_path_to_figures); + + DrawHist(cevTailBeetle1,hevTailBeetle1,"E",alg_path_to_figures); + DrawHist(cevTailBeetle2,hevTailBeetle2,"E",alg_path_to_figures); + + output->cd(); + + // Close input ROOT file. + input->Close(); + + return; +} + +#endif diff --git a/Software/ComputeCMN/CMNSubStraightLine.C b/Software/ComputeCMN/CMNSubStraightLine.C new file mode 100644 index 0000000..acfa804 --- /dev/null +++ b/Software/ComputeCMN/CMNSubStraightLine.C @@ -0,0 +1,538 @@ +//************************************************ +// Author: Federica Lionetto +// Created on: 11/12/2014 +//************************************************ + +/* + CMNSubStraightLine is one of the CMN subtraction algorithms. + + Pedestal subtracted ADC counts ---> Calculate mean and rms ---> Exclude signal (requiring |ADC-mean| Calculate mean and rms ---> Exclude signal (requiring |ADC-mean| Calculate the parameters of the straight line that approximates the data ---> Evaluate the expected ADC counts on each Beetle channel and subtract it to the measured ones ---> Pedestal and CMN subtracted ADC counts. + + It loops over events, creates the event-by-event distribution of the pedestal subtracted ADC counts (hADCPedSubBeetlex_1evt), calculates the mean and the rms, ignores strips that may potentially contain a signal and creates the event-by-event distribution of the pedestal subtracted ADC counts (hADCPedSubBeetlexNoSig_1evt), calculates the mean and the rms, ignores strips that may potentially contain a signal and creates the event-by-event distribution of the pedestal subtracted ADC counts (hADCPedSubBeetlexNoSig2_1evt), calculates the parameters of the straight line that approximates the data, evaluates the expected ADC counts on each Beetle channel, subtracts it to every strip, and creates the event-by-event distribution of the pedestal and CMN subtracted ADC counts (hADCPedCMNSubBeetlex_1evt). + If there is no common mode noise, the pedestal and the pedestal and CMN versions will look the same. + + It creates the distribution of the two parameters of the straight line y = a0+a1*x (ha0Beetlex and ha1Beetlex). + + It creates the distribution of the pedestal subtracted ADC counts (hADCPedSubBeetlex) and the distribution of the pedestal and CMN subtracted ADC counts (hADCPedCMNSubBeetlex), comparing the two. + + It creates the distribution of the RMS of the ADC count distribution for the following cases: + - pedestal subtracted ADC counts; + - pedestal subtracted ADC counts, after the first outlier removal; + - pedestal subtracted ADC counts, after the second outlier removal. + + In beam off data the ADC count distribution after CMN subtraction is not symmetric. + This might be explained by muons coming from the beam line and acting as "signal". + To check this hypothesis, it is interesting to look at the distribution of the Beetle channels contributing to the tail on the right (TH1F *hchTailBeetlex) and the distribution of the event numbers where this happens (TH1F *hevTailBeetlex). + + The configuration of the CMN algorithm is defined by factor. + The other arguments are: + - the number of one event to display, to check that the algorithm is working properly; + - the string corresponding to the input ROOT file, where to get the pedestal subtracted ADC counts from; + - the pointer to the output ROOT file, where to save the output of this algorithm; + - the string corresponding to the path where to save the pictures. + + CMNSubStraightLine will create a directory in the output ROOT file called "CMNSubStraightLine", where the tree (with CMN1, CMN2, and ADCPedCMNSub) and the histograms, graphs, and canvases will be stored. + */ + +// Header guard. +#ifndef __CMNSUBSTRAIGHTLINE_C_INCLUDED__ +#define __CMNSUBSTRAIGHTLINE_C_INCLUDED__ + +void CMNSubStraightLine(float factor, int sample, string input_ROOT, TFile *output, TString path_to_figures); + +float yStraightLine(float a0, float a1, float x); + +void CMNSubStraightLine(float factor, int sample, string input_ROOT, TFile *output, TString path_to_figures) +{ + cout << "**************************************************" << endl; + cout << "Computing CMN according to the straight line algorithm..." << endl; + cout << "**************************************************" << endl; + + cout << "**************************************************" << endl; + cout << "Configuration" << endl; + cout << "factor: " << factor << endl; + cout << "sample: " << sample << endl; + cout << "**************************************************" << endl; + + // Open input ROOT file. + cout << "Open input ROOT file: " << input_ROOT << endl; + TFile *input = TFile::Open(TString(input_ROOT)); + + input->cd(); + TTree *EventInfo = (TTree *)input->Get("EventInfo"); + int NEvents = EventInfo->GetEntries(); + + TString dirCMNSubStraightLine = "CMNSubStraightLine"; + output->cd(); + output->mkdir(dirCMNSubStraightLine); + output->cd(dirCMNSubStraightLine); + + TString alg_path_to_figures = path_to_figures+dirCMNSubStraightLine; + TString alg_path_to_make_figures = "mkdir -p "+alg_path_to_figures; + system(alg_path_to_make_figures.Data()); + + // Copy the EventInfo tree from the input to the output file and add some more information. + float a0Beetle1 = 0.; + float a1Beetle1 = 0.; + float a0Beetle2 = 0.; + float a1Beetle2 = 0.; + std::vector ADCPedCMNSub; // Raw ADC - pedestal - CMN. + + TTree *EventInfoProcessed = EventInfo->CloneTree(0); + std::vector *ADCProcessed = 0; + TBranch *b_ADCProcessed = 0; + EventInfo->SetBranchAddress("ADCProcessed",&ADCProcessed,&b_ADCProcessed); + EventInfoProcessed->Branch("a0Beetle1",&a0Beetle1); + EventInfoProcessed->Branch("a1Beetle1",&a1Beetle1); + EventInfoProcessed->Branch("a0Beetle2",&a0Beetle2); + EventInfoProcessed->Branch("a1Beetle2",&a1Beetle2); + + EventInfoProcessed->Branch("ADCPedCMNSub",&ADCPedCMNSub); + + // Event-by-event histograms. + + // Event-by-event distribution of the pedestal subtracted ADC counts (hADCPedSubBeetlex_1evt). + TH1F *hADCPedSubBeetle1_1evt = new TH1F("hADCPedSubBeetle1_1evt","",400,-200,200); // Modify it. + TCanvas *cADCPedSubBeetle1_1evt = new TCanvas("cADCPedSubBeetle1_1evt","",400,300); + InitHist(hADCPedSubBeetle1_1evt,"Pedestal subtracted ADC counts on Beetle 1","ADC counts",""); + + TH1F *hADCPedSubBeetle2_1evt = new TH1F("hADCPedSubBeetle2_1evt","",400,-200,200); //Modify it. + TCanvas *cADCPedSubBeetle2_1evt = new TCanvas("cADCPedSubBeetle2_1evt","",400,300); + InitHist(hADCPedSubBeetle2_1evt,"Pedestal subtracted ADC counts on Beetle 2","ADC counts",""); + + // Ignore strips that may potentially contain a signal. + // Event-by-event distribution of the pedestal subtracted ADC counts (hADCPedSubBeetlexNoSig_1evt). + + // First iteration. + TH1F *hADCPedSubBeetle1NoSig_1evt = new TH1F("hADCPedSubBeetle1NoSig_1evt","",400,-200,200); // Modify it. + TCanvas *cADCPedSubBeetle1NoSig_1evt = new TCanvas("cADCPedSubBeetle1NoSig_1evt","",400,300); + InitHist(hADCPedSubBeetle1NoSig_1evt,"Pedestal subtracted ADC counts on Beetle 1 - excluding signal","ADC counts",""); + + TH1F *hADCPedSubBeetle2NoSig_1evt = new TH1F("hADCPedSubBeetle2NoSig_1evt","",400,-200,200); //Modify it. + TCanvas *cADCPedSubBeetle2NoSig_1evt = new TCanvas("cADCPedSubBeetle2NoSig_1evt","",400,300); + InitHist(hADCPedSubBeetle2NoSig_1evt,"Pedestal subtracted ADC counts on Beetle 2 - excluding signal","ADC counts",""); + + // Second iteration. + TH1F *hADCPedSubBeetle1NoSig2_1evt = new TH1F("hADCPedSubBeetle1NoSig2_1evt","",400,-200,200); // Modify it. + TCanvas *cADCPedSubBeetle1NoSig2_1evt = new TCanvas("cADCPedSubBeetle1NoSig2_1evt","",400,300); + InitHist(hADCPedSubBeetle1NoSig2_1evt,"Pedestal subtracted ADC counts on Beetle 1 - excluding signal","ADC counts",""); + + TH1F *hADCPedSubBeetle2NoSig2_1evt = new TH1F("hADCPedSubBeetle2NoSig2_1evt","",400,-200,200); //Modify it. + TCanvas *cADCPedSubBeetle2NoSig2_1evt = new TCanvas("cADCPedSubBeetle2NoSig2_1evt","",400,300); + InitHist(hADCPedSubBeetle2NoSig2_1evt,"Pedestal subtracted ADC counts on Beetle 2 - excluding signal","ADC counts",""); + + // Event-by-event distribution of the pedestal and CMN subtracted ADC counts (hADCPedCMNSubBeetlex_1evt). + TH1F *hADCPedCMNSubBeetle1_1evt = new TH1F("hADCPedCMNSubBeetle1_1evt","",400,-200,200); // Modify it. + TCanvas *cADCPedCMNSubBeetle1_1evt = new TCanvas("cADCPedCMNSubBeetle1_1evt","",400,300); + InitHist(hADCPedCMNSubBeetle1_1evt,"Pedestal and CMN subtracted ADC counts on Beetle 1","ADC counts",""); + + TH1F *hADCPedCMNSubBeetle2_1evt = new TH1F("hADCPedCMNSubBeetle2_1evt","",400,-200,200); //Modify it. + TCanvas *cADCPedCMNSubBeetle2_1evt = new TCanvas("cADCPedCMNSubBeetle2_1evt","",400,300); + InitHist(hADCPedCMNSubBeetle2_1evt,"Pedestal and CMN subtracted ADC counts on Beetle 2","ADC counts",""); + + // Event-by-event distribution of how the event looks like, to check that the straight line is determined properly. + TH1F *hADCStraightLineBeetle1_1evt = new TH1F("hADCStraightLineBeetle1_1evt","",NBeetle,0,NBeetle); + TCanvas *cADCStraightLineBeetle1_1evt = new TCanvas("cADCStraightLineBeetle1_1evt","",400,300); + InitHist(hADCStraightLineBeetle1_1evt,"Event display of Beetle 1","Beetle channel","ADC counts"); + + TH1F *hADCStraightLineBeetle2_1evt = new TH1F("hADCStraightLineBeetle2_1evt","",NBeetle,NBeetle,N); + TCanvas *cADCStraightLineBeetle2_1evt = new TCanvas("cADCStraightLineBeetle2_1evt","",400,300); + InitHist(hADCStraightLineBeetle2_1evt,"Event display of Beetle 2","Beetle channel","ADC counts"); + + // Histograms containing the information on all events. + + // Beeetle 1. + TH1F *ha0Beetle1 = new TH1F("ha0Beetle1","",100,-50,50); // Modify it. + TCanvas *ca0Beetle1 = new TCanvas("ca0Beetle1","",400,300); + InitHist(ha0Beetle1,"a0 parameter for Beetle 1","a_{0} (ADC counts)",""); + + TH1F *ha1Beetle1 = new TH1F("ha1Beetle1","",100,-0.5,0.5); // Modify it. + TCanvas *ca1Beetle1 = new TCanvas("ca1Beetle1","",400,300); + InitHist(ha1Beetle1,"a1 parameter for Beetle 1","a_{1} (ADC counts)",""); + + // Beetle 2. + TH1F *ha0Beetle2 = new TH1F("ha0Beetle2","",100,-50,50); // Modify it. + TCanvas *ca0Beetle2 = new TCanvas("ca0Beetle2","",400,300); + InitHist(ha0Beetle2,"a0 parameter for Beetle 2","a_{0} (ADC counts)",""); + + TH1F *ha1Beetle2 = new TH1F("ha1Beetle2","",100,-0.5,0.5); // Modify it. + TCanvas *ca1Beetle2 = new TCanvas("ca1Beetle2","",400,300); + InitHist(ha1Beetle2,"a1 parameter for Beetle 2","a_{1} (ADC counts)",""); + + // Distribution of the pedestal subtracted ADC counts (hADCPedSubBeetlex). + TH1F *hADCPedSubBeetle1 = new TH1F("hADCPedSubBeetle1","",400,-200,200); + InitHist(hADCPedSubBeetle1,"Pedestal subtracted ADC counts on Beetle 1","ADC counts",""); + TH1F *hADCPedSubBeetle2 = new TH1F("hADCPedSubBeetle2","",400,-200,200); + InitHist(hADCPedSubBeetle2,"Pedestal subtracted ADC counts on Beetle 2","ADC counts",""); + + // Distribution of the pedestal and CMN subtracted ADC counts (hADCPedCMNSubBeetlex). + TH1F *hADCPedCMNSubBeetle1 = new TH1F("hADCPedCMNSubBeetle1","",400,-200,200); + InitHist(hADCPedCMNSubBeetle1,"Pedestal and CMN subtracted ADC counts on Beetle 1","ADC counts",""); + TH1F *hADCPedCMNSubBeetle2 = new TH1F("hADCPedCMNSubBeetle2","",400,-200,200); + InitHist(hADCPedCMNSubBeetle2,"Pedestal and CMN subtracted ADC counts on Beetle 2","ADC counts",""); + + TCanvas *cADCCompBeetle1 = new TCanvas("cADCCompBeetle1","",400,300); + TCanvas *cADCCompBeetle2 = new TCanvas("cADCCompBeetle2","",400,300); + + // Distribution of the RMS of the ADC count distribution for the following cases: + // - pedestal subtracted ADC counts; + // - pedestal subtracted ADC counts, after the first outlier removal; + // - pedestal subtracted ADC counts, after the second outlier removal. + TH1F *hRMSPedSubBeetle1 = new TH1F("hRMSPedSubBeetle1","",90,0,30); + TH1F *hRMSPedSubBeetle1NoSig = new TH1F("hRMSPedSubBeetle1NoSig","",90,0,30); + TH1F *hRMSPedSubBeetle1NoSig2 = new TH1F("hRMSPedSubBeetle1NoSig2","",90,0,30); + TH1F *hRMSPedSubBeetle2 = new TH1F("hRMSPedSubBeetle2","",90,0,30); + TH1F *hRMSPedSubBeetle2NoSig = new TH1F("hRMSPedSubBeetle2NoSig","",90,0,30); + TH1F *hRMSPedSubBeetle2NoSig2 = new TH1F("hRMSPedSubBeetle2NoSig2","",90,0,30); + + InitHist(hRMSPedSubBeetle1,"RMS of pedestal subtracted ADC counts on Beetle 1","RMS (ADC counts)",""); + InitHist(hRMSPedSubBeetle1NoSig,"RMS of pedestal subtracted ADC counts on Beetle 1","RMS (ADC counts)",""); + InitHist(hRMSPedSubBeetle1NoSig2,"RMS of pedestal subtracted ADC counts on Beetle 1","RMS (ADC counts)",""); + InitHist(hRMSPedSubBeetle2,"RMS of pedestal subtracted ADC counts on Beetle 2","RMS (ADC counts)",""); + InitHist(hRMSPedSubBeetle2NoSig,"RMS of pedestal subtracted ADC counts on Beetle 2","RMS (ADC counts)",""); + InitHist(hRMSPedSubBeetle2NoSig2,"RMS of pedestal subtracted ADC counts on Beetle 2","RMS (ADC counts)",""); + + TCanvas *cRMSBeetle1 = new TCanvas("cRMSBeetle1","",400,300); + TCanvas *cRMSBeetle2 = new TCanvas("cRMSBeetle2","",400,300); + + // In beam off data the ADC count distribution after CMN subtraction is not symmetric. + // This might be explained by muons coming from the beam line and acting as "signal". + // To check this hypothesis, it is interesting to look at the distribution of the Beetle channels contributing to the tail on the right (TH1F *hchTailBeetlex) and the distribution of the event numbers where this happens (TH1F *hevTailBeetlex). + TH1F *hchTailBeetle1 = new TH1F("hcdTailBeetle1","",NBeetle,0,NBeetle); + TH1F *hchTailBeetle2 = new TH1F("hcdTailBeetle2","",NBeetle,NBeetle,N); + + InitHist(hchTailBeetle1,"Asymmetric tail on Beetle 1","Beetle channel",""); + InitHist(hchTailBeetle2,"Asymmetric tail on Beetle 2","Beetle channel",""); + + TCanvas *cchTailBeetle1 = new TCanvas("cchTailBeetle1","",400,300); + TCanvas *cchTailBeetle2 = new TCanvas("cchTailBeetle2","",400,300); + + TH1F *hevTailBeetle1 = new TH1F("hevTailBeetle1","",50,0,NEvents+1); + TH1F *hevTailBeetle2 = new TH1F("hevTailBeetle2","",50,0,NEvents+1); + + InitHist(hevTailBeetle1,"Asymmetric tail on Beetle 1","Event number",""); + InitHist(hevTailBeetle2,"Asymmetric tail on Beetle 2","Event number",""); + + TCanvas *cevTailBeetle1 = new TCanvas("cevTailBeetle1","",400,300); + TCanvas *cevTailBeetle2 = new TCanvas("cevTailBeetle2","",400,300); + + // Add the histograms with the pedestal and CMN subtracted distribution of the ADC counts of each Beetle channel (TH1F *hADCPedCMNSub[N]) to the output file. + TH1F *hADCPedCMNSub[N]; + for (int iChannel=0;iChannelSetLineColor(kAzure); + + // Beetle2. + + float meanBeetle2_temp; + float rmsBeetle2_temp; + float xmeanBeetle2 = 0.; + float ymeanBeetle2 = 0.; + float x2meanBeetle2 = 0.; + float xymeanBeetle2 = 0.; + float nAvBeetle2 = 0.; + + TF1 *fBeetle2 = new TF1("fBeetle2","pol1",(float)NBeetle,(float)N); + fBeetle2->SetLineColor(kAzure); + + // Fill histograms. + for (int iEvent=0;iEvent0) + { + ADCPedCMNSub.clear(); + hADCPedSubBeetle1_1evt->Reset(); + hADCPedSubBeetle2_1evt->Reset(); + hADCPedSubBeetle1NoSig_1evt->Reset(); + hADCPedSubBeetle2NoSig_1evt->Reset(); + hADCPedSubBeetle1NoSig2_1evt->Reset(); + hADCPedSubBeetle2NoSig2_1evt->Reset(); + hADCPedCMNSubBeetle1_1evt->Reset(); + hADCPedCMNSubBeetle2_1evt->Reset(); + hADCStraightLineBeetle1_1evt->Reset(); + hADCStraightLineBeetle2_1evt->Reset(); + + xmeanBeetle1 = 0.; + ymeanBeetle1 = 0.; + x2meanBeetle1 = 0.; + xymeanBeetle1 = 0.; + nAvBeetle1 = 0.; + xmeanBeetle2 = 0.; + ymeanBeetle2 = 0.; + x2meanBeetle2 = 0.; + xymeanBeetle2 = 0.; + nAvBeetle2 = 0.; + } + + EventInfo->GetEntry(iEvent); + + // Fill histograms for Beetle 1. + for (int iChannel=0;iChannelFill((float)ADCProcessed->at(iChannel)); + hADCPedSubBeetle1_1evt->Fill((float)ADCProcessed->at(iChannel)); + } + } + + // Exclude signal. + meanBeetle1_temp = hADCPedSubBeetle1_1evt->GetMean(); + rmsBeetle1_temp = hADCPedSubBeetle1_1evt->GetRMS(); + + hRMSPedSubBeetle1->Fill(rmsBeetle1_temp); + + // Fill histograms again for Beetle 1. + for (int iChannel=0;iChannelat(iChannel)-meanBeetle1_temp)Fill((float)ADCProcessed->at(iChannel)); + } + } + + // Exclude signal. + meanBeetle1_temp = hADCPedSubBeetle1NoSig_1evt->GetMean(); + rmsBeetle1_temp = hADCPedSubBeetle1NoSig_1evt->GetRMS(); + + hRMSPedSubBeetle1NoSig->Fill(rmsBeetle1_temp); + + // Fill histograms again for Beetle 1. + for (int iChannel=0;iChannelat(iChannel)-meanBeetle1_temp)Fill((float)ADCProcessed->at(iChannel)); + xmeanBeetle1 = xmeanBeetle1+(float)iChannel; + ymeanBeetle1 = ymeanBeetle1+(float)ADCProcessed->at(iChannel); + x2meanBeetle1 = x2meanBeetle1+((float)iChannel)*((float)iChannel); + xymeanBeetle1 = xymeanBeetle1+(float)iChannel*(float)ADCProcessed->at(iChannel); + nAvBeetle1++; + hADCStraightLineBeetle1_1evt->Fill((float)iChannel,(float)ADCProcessed->at(iChannel)); + } + } + } + + // Divide by nAvBeetle1 to get the averaged quantities. + xmeanBeetle1 = xmeanBeetle1/nAvBeetle1; + ymeanBeetle1 = ymeanBeetle1/nAvBeetle1; + x2meanBeetle1 = x2meanBeetle1/nAvBeetle1; + xymeanBeetle1 = xymeanBeetle1/nAvBeetle1; + + // Calculate CMN1. + a0Beetle1 = (x2meanBeetle1*ymeanBeetle1-xmeanBeetle1*xymeanBeetle1)/(x2meanBeetle1-xmeanBeetle1*xmeanBeetle1); + a1Beetle1 = (xymeanBeetle1-xmeanBeetle1*ymeanBeetle1)/(x2meanBeetle1-xmeanBeetle1*xmeanBeetle1); + + ha0Beetle1->Fill(a0Beetle1); + ha1Beetle1->Fill(a1Beetle1); + + // Draw CMN1. + fBeetle1->SetParameter(0,a0Beetle1); + fBeetle1->SetParameter(1,a1Beetle1); + + if (iEvent == sample) + { + cout << "Beetle 1" << endl; + + cout << "Value of a0: " << a0Beetle1 << endl; + cout << "Value of a1: " << a1Beetle1 << endl; + + cout << "Value of a0: " << fBeetle1->GetParameter(0) << endl; + cout << "Value of a1: " << fBeetle1->GetParameter(1) << endl; + } + + rmsBeetle1_temp = hADCPedSubBeetle1NoSig2_1evt->GetRMS(); + + hRMSPedSubBeetle1NoSig2->Fill(rmsBeetle1_temp); + + // Fill histograms for Beetle 2. + for (int iChannel=NBeetle;iChannelFill((float)ADCProcessed->at(iChannel)); + hADCPedSubBeetle2_1evt->Fill((float)ADCProcessed->at(iChannel)); + } + } + + // Exclude signal. + meanBeetle2_temp = hADCPedSubBeetle2_1evt->GetMean(); + rmsBeetle2_temp = hADCPedSubBeetle2_1evt->GetRMS(); + + hRMSPedSubBeetle2->Fill(rmsBeetle2_temp); + + // Fill histograms again for Beetle 2. + for (int iChannel=NBeetle;iChannelat(iChannel)-meanBeetle2_temp)Fill((float)ADCProcessed->at(iChannel)); + } + } + + // Exclude signal. + meanBeetle2_temp = hADCPedSubBeetle2NoSig_1evt->GetMean(); + rmsBeetle2_temp = hADCPedSubBeetle2NoSig_1evt->GetRMS(); + + hRMSPedSubBeetle2NoSig->Fill(rmsBeetle2_temp); + + // Fill histograms again for Beetle 2. + for (int iChannel=NBeetle;iChannelat(iChannel)-meanBeetle2_temp)Fill((float)ADCProcessed->at(iChannel)); + xmeanBeetle2 = xmeanBeetle2+(float)iChannel; + ymeanBeetle2 = ymeanBeetle2+(float)ADCProcessed->at(iChannel); + x2meanBeetle2 = x2meanBeetle2+((float)iChannel)*((float)iChannel); + xymeanBeetle2 = xymeanBeetle2+(float)iChannel*(float)ADCProcessed->at(iChannel); + nAvBeetle2++; + hADCStraightLineBeetle2_1evt->Fill((float)iChannel,(float)ADCProcessed->at(iChannel)); + } + } + } + + // Divide by nAvBeetle2 to get the averaged quantities. + xmeanBeetle2 = xmeanBeetle2/nAvBeetle2; + ymeanBeetle2 = ymeanBeetle2/nAvBeetle2; + x2meanBeetle2 = x2meanBeetle2/nAvBeetle2; + xymeanBeetle2 = xymeanBeetle2/nAvBeetle2; + + // Calculate CMN2. + a0Beetle2 = (x2meanBeetle2*ymeanBeetle2-xmeanBeetle2*xymeanBeetle2)/(x2meanBeetle2-xmeanBeetle2*xmeanBeetle2); + a1Beetle2 = (xymeanBeetle2-xmeanBeetle2*ymeanBeetle2)/(x2meanBeetle2-xmeanBeetle2*xmeanBeetle2); + + ha0Beetle2->Fill(a0Beetle2); + ha1Beetle2->Fill(a1Beetle2); + + // Draw CMN2. + fBeetle2->SetParameter(0,a0Beetle2); + fBeetle2->SetParameter(1,a1Beetle2); + + if (iEvent == sample) + { + cout << "Beetle 2" << endl; + + cout << "Value of a0: " << a0Beetle2 << endl; + cout << "Value of a1: " << a1Beetle2 << endl; + + cout << "Value of a0: " << fBeetle2->GetParameter(0) << endl; + cout << "Value of a1: " << fBeetle2->GetParameter(1) << endl; + } + + rmsBeetle2_temp = hADCPedSubBeetle2NoSig2_1evt->GetRMS(); + + hRMSPedSubBeetle2NoSig2->Fill(rmsBeetle2_temp); + + // Subtract CMN1. + for (int iChannel=0;iChannelat(iChannel)-yStraightLine(a0Beetle1,a1Beetle1,(float)iChannel)); + hADCPedCMNSub[iChannel]->Fill((float)ADCProcessed->at(iChannel)-yStraightLine(a0Beetle1,a1Beetle1,(float)iChannel)); + if (maskBeetle1[iChannel] == 0) + { + hADCPedCMNSubBeetle1->Fill((float)ADCProcessed->at(iChannel)-yStraightLine(a0Beetle1,a1Beetle1,(float)iChannel)); + hADCPedCMNSubBeetle1_1evt->Fill((float)ADCProcessed->at(iChannel)-yStraightLine(a0Beetle1,a1Beetle1,(float)iChannel)); + if (((float)ADCProcessed->at(iChannel)-yStraightLine(a0Beetle1,a1Beetle1,(float)iChannel)) > 30.) + { + cout << "The event #" << iEvent << " has at least one Beetle channels (" << iChannel << ") contributing to the tail" << endl; + hchTailBeetle1->Fill(iChannel); + hevTailBeetle1->Fill(iEvent); + } + } + } + + // Subtract CMN2. + for (int iChannel=NBeetle;iChannelat(iChannel)-yStraightLine(a0Beetle2,a1Beetle2,(float)iChannel)); + hADCPedCMNSub[iChannel]->Fill((float)ADCProcessed->at(iChannel)-yStraightLine(a0Beetle2,a1Beetle2,(float)iChannel)); + if (maskBeetle2[iChannel-NBeetle] == 0) + { + hADCPedCMNSubBeetle2->Fill((float)ADCProcessed->at(iChannel)-yStraightLine(a0Beetle2,a1Beetle2,(float)iChannel)); + hADCPedCMNSubBeetle2_1evt->Fill((float)ADCProcessed->at(iChannel)-yStraightLine(a0Beetle2,a1Beetle2,(float)iChannel)); + if (((float)ADCProcessed->at(iChannel)-yStraightLine(a0Beetle2,a1Beetle2,(float)iChannel)) > 30.) + { + cout << "The event #" << iEvent << " has at least one Beetle channels (" << iChannel << ") contributing to the tail" << endl; + hchTailBeetle2->Fill(iChannel); + hevTailBeetle2->Fill(iEvent); + } + } + } + + EventInfoProcessed->Fill(); + + if (iEvent==sample) { + DrawHist(cADCPedSubBeetle1_1evt,hADCPedSubBeetle1_1evt,"",alg_path_to_figures); + DrawHist(cADCPedSubBeetle2_1evt,hADCPedSubBeetle2_1evt,"",alg_path_to_figures); + DrawHist(cADCPedSubBeetle1NoSig_1evt,hADCPedSubBeetle1NoSig_1evt,"",alg_path_to_figures); + DrawHist(cADCPedSubBeetle2NoSig_1evt,hADCPedSubBeetle2NoSig_1evt,"",alg_path_to_figures); + DrawHist(cADCPedSubBeetle1NoSig2_1evt,hADCPedSubBeetle1NoSig2_1evt,"",alg_path_to_figures); + DrawHist(cADCPedSubBeetle2NoSig2_1evt,hADCPedSubBeetle2NoSig2_1evt,"",alg_path_to_figures); + DrawHist(cADCPedCMNSubBeetle1_1evt,hADCPedCMNSubBeetle1_1evt,"",alg_path_to_figures); + DrawHist(cADCPedCMNSubBeetle2_1evt,hADCPedCMNSubBeetle2_1evt,"",alg_path_to_figures); + + hADCStraightLineBeetle1_1evt->SetStats(0); + hADCStraightLineBeetle2_1evt->SetStats(0); + + DrawHistFunc(cADCStraightLineBeetle1_1evt,hADCStraightLineBeetle1_1evt,fBeetle1,alg_path_to_figures); + DrawHistFunc(cADCStraightLineBeetle2_1evt,hADCStraightLineBeetle2_1evt,fBeetle2,alg_path_to_figures); + } + + } + + DrawHist(ca0Beetle1,ha0Beetle1,"",alg_path_to_figures); + DrawHist(ca1Beetle1,ha1Beetle1,"",alg_path_to_figures); + + DrawHist(ca0Beetle2,ha0Beetle2,"",alg_path_to_figures); + DrawHist(ca1Beetle2,ha1Beetle2,"",alg_path_to_figures); + + TLegend *legADCCompBeetle1 = CreateLegend2(hADCPedSubBeetle1,"ped sub",hADCPedCMNSubBeetle1,"ped + CMN sub"); + TLegend *legADCCompBeetle2 = CreateLegend2(hADCPedSubBeetle2,"ped sub",hADCPedCMNSubBeetle2,"ped + CMN sub"); + + cADCCompBeetle1->SetLogy(); + cADCCompBeetle2->SetLogy(); + + DrawHistCompare(cADCCompBeetle1,hADCPedSubBeetle1,hADCPedCMNSubBeetle1,legADCCompBeetle1,alg_path_to_figures); + DrawHistCompare(cADCCompBeetle2,hADCPedSubBeetle2,hADCPedCMNSubBeetle2,legADCCompBeetle2,alg_path_to_figures); + + TLegend *legRMSBeetle1 = CreateLegend3(hRMSPedSubBeetle1,"ped sub",hRMSPedSubBeetle1NoSig,"after 1st outlier removal",hRMSPedSubBeetle1NoSig2,"after 2nd outlier removal","lpfw",0.42,0.59,0.94,0.89); + TLegend *legRMSBeetle2 = CreateLegend3(hRMSPedSubBeetle2,"ped sub",hRMSPedSubBeetle2NoSig,"after 1st outlier removal",hRMSPedSubBeetle2NoSig2,"after 2nd outlier removal","lpfw",0.42,0.59,0.94,0.89); + + DrawHistCompare3(cRMSBeetle1,hRMSPedSubBeetle1,hRMSPedSubBeetle1NoSig,hRMSPedSubBeetle1NoSig2,legRMSBeetle1,alg_path_to_figures); + DrawHistCompare3(cRMSBeetle2,hRMSPedSubBeetle2,hRMSPedSubBeetle2NoSig,hRMSPedSubBeetle2NoSig2,legRMSBeetle2,alg_path_to_figures); + + DrawHist(cchTailBeetle1,hchTailBeetle1,"E",alg_path_to_figures); + DrawHist(cchTailBeetle2,hchTailBeetle2,"E",alg_path_to_figures); + + DrawHist(cevTailBeetle1,hevTailBeetle1,"E",alg_path_to_figures); + DrawHist(cevTailBeetle2,hevTailBeetle2,"E",alg_path_to_figures); + + output->cd(); + + // Close input ROOT file. + input->Close(); + + return; +} + +float yStraightLine(float a0, float a1, float x) +{ + return a0+a1*x; +} + +#endif diff --git a/Software/ComputeCMN/ComputeCMN.C b/Software/ComputeCMN/ComputeCMN.C new file mode 100644 index 0000000..85e35b7 --- /dev/null +++ b/Software/ComputeCMN/ComputeCMN.C @@ -0,0 +1,299 @@ +//************************************************ +// Author: Federica Lionetto +// Created on: 08/01/2014 +//************************************************ + +/* + ComputeCMN reads a ROOT file (containing the raw data and the data after pedestal subtraction) and creates a ROOT file with the following information: + - all branches in the Header tree; + - all branches in the EventInfo tree, one per event (different folders for different CMN subtraction algorithms); + - float CMN1 (Beetle chip 1), one per event (different folders for different CMN subtraction algorithms); + - float CMN2 (Beetle chip 2), one per event (different folders for different CMN subtraction algorithms); + - std::vector ADCCMNSub, one per event (ADC after pedestal and CMN subtraction, different folders for different CMN subtraction algorithms); + - several distributions, described below. + + The CMN subtraction algorithms are applied after masking the appropriate Beetle channels (cross talk from the header of the Beetle chip, strips and/or Beeetle channels shorted and/or not properly wire bonded). + + Compile with: + + make + + Run with: + + ./ComputeCMN [input ROOT file] [sensor] [additional folder] + +where: +- [input ROOT file] is the complete path, including the folder and the filename, of the ROOT file one wants to process; +- [sensor] is the string identifying the sensor (UZHDaughterBoard, Hans410, Hans320, ATLAS, NoSensor); +- [additional folder] is the optional additional folder where the output will be saved. + +Example of input ROOT file: +~/LHCb/UTTestBeam/AnalysisResults/CMNStudies/ProcessRawData-filename.root + +Example of output ROOT file: +~/LHCb/UTTestBeam/AnalysisResults/CMNStudies/ComputeCMN-filename.root +*/ + +#include "../Tools/Lib.C" +#include "../Tools/lhcbStyle.C" +#include "../Tools/Style.C" + +#include "../Tools/Par.C" + +#include "../Tools/Masking.C" + +#include "CMNSubMean.C" +#include "CMNSubMean2.C" +#include "CMNSubMeanOddEven.C" +#include "CMNSubMeanxStrips.C" +#include "CMNSubStraightLine.C" + +void ComputeCMN(char *filename, char *sensor, char *externalPath=0); + +int main(int argc, char *argv[]) +{ + getLHCbStyle(); + PersonalStyle(); + + if ((argc == 2) && (string(argv[1]) == "--info")) + { + cout << "**************************************************" << endl; + + cout << "ComputeCMN reads a ROOT file (containing the raw data and the data after pedestal subtraction) and creates a ROOT file with the following information:" << endl; + cout << "- all branches in the Header tree;" << endl; + cout << "- all branches in the EventInfo tree, one per event (different folders for different CMN subtraction algorithms);" << endl; + cout << "- float CMN1 (Beetle chip 1), one per event (different folders for different CMN subtraction algorithms);" << endl; + cout << "- float CMN2 (Beetle chip 2), one per event (different folders for different CMN subtraction algorithms);" << endl; + cout << "- std::vector ADCCMNSub, one per event (ADC after pedestal and CMN subtraction, different folders for different CMN subtraction algorithms);" << endl; + cout << "- several distributions, described below." << endl; + + cout << " " << endl; + + cout << "The CMN subtraction algorithms are applied after masking the appropriate Beetle channels (cross talk from the header of the Beetle chip, strips and/or Beeetle channels shorted and/or not properly wire bonded)." << endl; + + cout << " " << endl; + + cout << "Compile with:" << endl; + + cout << " " << endl; + + cout << "make" << endl; + + cout << " " << endl; + + cout << "Run with:" << endl; + + cout << " " << endl; + + cout << "./ComputeCMN [input ROOT file] [sensor] [additional folder]" << endl; + + cout << "where:" << endl; + cout << "- [input ROOT file] is the complete path, including the folder and the filename, of the ROOT file one wants to process;" << endl; + cout << "- [sensor] is the string identifying the sensor (UZHDaughterBoard, Hans410, Hans320, ATLAS, NoSensor);" << endl; + cout << "- [additional folder] is the optional additional folder where the output will be saved." << endl; + + cout << "Example of input ROOT file:" << endl; + cout << "~/LHCb/UTTestBeam/AnalysisResults/CMNStudies/ProcessRawData-filename.root" << endl; + + cout << "Example of output ROOT file:" << endl; + cout << "~/LHCb/UTTestBeam/AnalysisResults/CMNStudies/ComputeCMN-filename.root" << endl; + + cout << "**************************************************" << endl; + + return 0; + } + else if (argc < 3) + { + cout << "**************************************************" << endl; + + cout << "Error! Input file missing..." << endl; + cout << "Please use the following format:" << endl; + cout << "./ComputeCMN [1] [2] [3]" << endl; + cout << "with:" << endl; + cout << "[1] = Input ROOT file, complete path;" << endl; + cout << "[2] = Sensor (UZHDaughterBoard, Hans410, Hans320, ATLAS, NoSensor);" << endl; + cout << "[3] = Additional folder, optional." << endl; + cout << "Type ./ComputeCMN --info for more information." << endl; + + cout << "**************************************************" << endl; + + return 0; + } + else + { + cout << "File to process: " << argv[1] << endl; + cout << "Sensor: " << argv[2] << endl; + if (argc == 3) + ComputeCMN(argv[1],argv[2]); + else if (argc == 4) + ComputeCMN(argv[1],argv[2],argv[3]); + else + { + cout << "Error! Too many arguments given..." << endl; + + return 0; + } + + return 0; + } +} + +void ComputeCMN(char *filename, char *sensor, char *externalPath) +{ + cout << "**************************************************" << endl; + cout << "Computing CMN..." << endl; + cout << "**************************************************" << endl; + + // Do not comment this line. + gROOT->ProcessLine("#include "); + + // Do some fanciness to get the directory right. + string inputDirectory = (string(filename)).substr(0,(string(filename)).find_last_of('/')); + // string inputDirectory = "~/LHCb/UTTestBeam/AnalysisResults/CMNStudies"; + string outputDirectory = inputDirectory; + // string outputDirectory = "~/LHCb/UTTestBeam/AnalysisResults/CMNStudies"; + string inFilenameNoPathNoExtension = (string(filename)).substr((string(filename)).find_last_of('/')+1); + inFilenameNoPathNoExtension = inFilenameNoPathNoExtension.substr(0,inFilenameNoPathNoExtension.find_last_of('.')); + string outFilenameNoPathNoExtension = "ComputeCMN-"+inFilenameNoPathNoExtension.substr(inFilenameNoPathNoExtension.find_first_of('-')+1); + if (externalPath!=0) + outputDirectory = string(outputDirectory+"/"+externalPath); + cout << "The input directory is: " << inputDirectory << endl; + cout << "The output directory is: " << outputDirectory << endl; + cout << "The name of the input ROOT file is: " << inFilenameNoPathNoExtension << endl; + cout << "The name of the output ROOT file is: " << outFilenameNoPathNoExtension << endl; + + // Create the outputDirectory directory if it does not exist. + string path_to_make = "mkdir -p "+outputDirectory; + system(path_to_make.c_str()); + + cout << "Figures stored in: " << outputDirectory+"/Figures/"+inFilenameNoPathNoExtension << endl; + + // Create a directory named Figures inside the directory named outputDirectory if it does not exist. + string path_to_make_figures = "mkdir -p "+outputDirectory+"/Figures/"+inFilenameNoPathNoExtension; + system(path_to_make_figures.c_str()); + + TString path_to_figures = (string(path_to_make_figures)).substr((string(path_to_make_figures)).find_last_of(' ')+1); + + string input_ROOT = filename; + string output_ROOT = outputDirectory+"/"+outFilenameNoPathNoExtension+".root"; + + // Open input ROOT file. + cout << "Open input ROOT file: " << input_ROOT << endl; + TFile *input = TFile::Open(TString(input_ROOT)); + + // Sanity checks for input ROOT file. + int NEvents; + TBranch *b_NEvents = 0; + + // Get info from trees. + TTree *Header = (TTree *)input->Get("Header"); + int EventsHeader = Header->GetEntries(); + if (EventsHeader != 1) + { + cout << "Error! The ROOT file has been corrupted..." << endl; + + return ; + } + else + { + Header->SetBranchAddress("NEvents",&NEvents,&b_NEvents); + + Header->GetEntry(); + + cout << "Number of events: " << NEvents << endl; + } + + // Get info from trees. + TTree *EventInfo = (TTree *)input->Get("EventInfo"); + int EventsEventInfo = EventInfo->GetEntries(); + if (EventsEventInfo != NEvents) + { + cout << "Error! The ROOT file has been corrupted..." << endl; + + return; + } + + // Open output ROOT file. + cout << "Open output ROOT file: " << output_ROOT << endl; + TFile *output = TFile::Open(TString(output_ROOT),"RECREATE"); + + // Copy the Header tree from the input to the output file. + TTree *HeaderProcessed = Header->CloneTree(0); + HeaderProcessed->Fill(); + + // Copy the histograms with the distribution of the ADC counts of each Beetle channel (TH1F *hADC[N], before pedestal subtraction, and TH1F *hADCPedSub[N], after pedestal subtraction) from the input file to the output file. + TH1F *hADC[N]; + TH1F *hADCPedSub[N]; + for (int iChannel=0;iChannelGet(Form("hADC%d",iChannel)); + hADCPedSub[iChannel] = (TH1F *)input->Get(Form("hADCPedSub%d",iChannel)); + + hADC[iChannel]->Write(); + hADCPedSub[iChannel]->Write(); + } + + // Close input ROOT file. + input->Close(); + + // Masking + cout << "Masking " << filename << endl; + Masking(string(sensor)); + + // Show the distributions for one particular event. + int sample = 1000; // Modify it. + + // Configuration of the CMNSubMean CMN subtraction algorithm. + float th1 = 19.; // Modify it. + float th2 = 19.; // Modify it. + + CMNSubMean(th1,th2,sample,input_ROOT,output,path_to_figures); + + // Configuration of the CMNSubMean2, CMNSubMeanOddEven, CMNSubMeanxStrips, and CMNSubStraightLine CMN subtraction algorithms. + float factor = 3.; // Modify it. + + CMNSubMean2(factor,sample,input_ROOT,output,path_to_figures); + CMNSubMeanOddEven(factor,sample,input_ROOT,output,path_to_figures); + + // Configuration of the CMNSubMeanxStrips CMN subtraction algorithm. + factor = 3.; + float x = 64.; // Modify it. + + if (x==0) + cout << "Error! The number of Beetle channels per group is zero. The CMNSubMeanxStrips algorithm will not be executed." << endl; + else if (NBeetle%(int)x!=0) + cout << "Error! The number of Beetle channels per group is not a divisor of the total number of Beetle channels. The CMNSubMeanxStrips algorithm will not be executed." << endl; + else + CMNSubMeanxStrips(x,factor,sample,input_ROOT,output,path_to_figures); + + factor = 2.2; + x = 32.; // Modify it. + + if (x==0) + cout << "Error! The number of Beetle channels per group is zero. The CMNSubMeanxStrips algorithm will not be executed." << endl; + else if (NBeetle%(int)x!=0) + cout << "Error! The number of Beetle channels per group is not a divisor of the total number of Beetle channels. The CMNSubMeanxStrips algorithm will not be executed." << endl; + else + CMNSubMeanxStrips(x,factor,sample,input_ROOT,output,path_to_figures); + + factor = 1.5; + x = 16.; // Modify it. + + if (x==0) + cout << "Error! The number of Beetle channels per group is zero. The CMNSubMeanxStrips algorithm will not be executed." << endl; + else if (NBeetle%(int)x!=0) + cout << "Error! The number of Beetle channels per group is not a divisor of the total number of Beetle channels. The CMNSubMeanxStrips algorithm will not be executed." << endl; + else + CMNSubMeanxStrips(x,factor,sample,input_ROOT,output,path_to_figures); + + factor = 3.; + + CMNSubStraightLine(factor,sample,input_ROOT,output,path_to_figures); + + output->cd(); + output->Write(); + output->Close(); + + return; +} + + diff --git a/Software/ComputeCMN/Makefile b/Software/ComputeCMN/Makefile new file mode 100755 index 0000000..bace215 --- /dev/null +++ b/Software/ComputeCMN/Makefile @@ -0,0 +1,34 @@ +# +CC=$(CXX) +glib_cflags=$(shell pkg-config --cflags glib-2.0 gio-2.0) +glib_libs=$(shell pkg-config --libs glib-2.0 gio-2.0) + +ROOTC=$(shell root-config --cflags) +ROOTL=$(shell root-config --libs) +OPT=-g -fno-inline #-std=c++11 +CppFLAGS=$(OPT) -I. $(glib_cflags) +CXXFLAGS=-fPIC $(CppFLAGS) + + +UNAME_S := $(shell uname -s) +ifeq ($(UNAME_S),Linux) + SO=so + SO_FLAGS=-shared + CXXFLAGS += -D LINUX +endif +ifeq ($(UNAME_S),Darwin) + SO=dylib + SO_FLAGS=-dynamiclib -undefined dynamic_lookup -install_name @rpath/$@ + CXXFLAGS += -D OSX +endif + +all: ComputeCMN + +ComputeCMN: ComputeCMN.C + c++ -I$(OPT) $(CXXFLAGS) $(ROOTC) -o $@ $^ $(LDLIBS) $(ROOTL) $(gliblibs) + + +clean: + rm -f *.o ComputeCMN + rm -rf *.dSYM + diff --git a/Software/LaserDelayScan/LaserDelayScan.C b/Software/LaserDelayScan/LaserDelayScan.C index 9a4f19e..2ee286e 100644 --- a/Software/LaserDelayScan/LaserDelayScan.C +++ b/Software/LaserDelayScan/LaserDelayScan.C @@ -203,8 +203,8 @@ // Fit with a polynomial function of degree 2 and get the delay and the signal at the peak. // gStyle->SetOptFit(0011); - float minFit = 47.; - float maxFit = 75.; + float minFit = 55.; + float maxFit = 80.; TF1 *fpol2 = new TF1("fpol2","pol2",minFit,maxFit); glaserDelayScan->Fit("fpol2","R"); diff --git a/Software/Monitoring/PlotTrends.C b/Software/Monitoring/PlotTrends.C index caaf513..25d2c25 100644 --- a/Software/Monitoring/PlotTrends.C +++ b/Software/Monitoring/PlotTrends.C @@ -425,7 +425,7 @@ gDP->SetMarkerColor(kRed); gDP->SetLineColor(kRed); - TLegend *legTandDP = CreateLegend2(gT,"temperature",gDP,"dew point","lpw",0.63,0.59,0.88,0.84); + TLegend *legTandDP = CreateLegend2(gT,"temperature",gDP,"dew point","lpw",0.63,0.38,0.88,0.63); mgTandDP->Add(gT); mgTandDP->Add(gDP); diff --git a/Software/ProcessRawData/ProcessRawData.C b/Software/ProcessRawData/ProcessRawData.C index 501dbc0..3c750bd 100644 --- a/Software/ProcessRawData/ProcessRawData.C +++ b/Software/ProcessRawData/ProcessRawData.C @@ -238,20 +238,13 @@ // Distribution of the ADC counts of each Beetle channel (TH1F *hADC[N], before pedestal subtraction, and TH1F *hADCPedSub[N], after pedestal subtraction); TH1F *hADC[N]; - TCanvas *cADC[N]; - TH1F *hADCPedSub[N]; - TCanvas *cADCPedSub[N]; for (int iChannel=0;iChannelScale(1./EventsEventInfo); hmapConnected->Scale(1./EventsEventInfo); - if ((sensorID == "Hans410") || (sensorID == "Hans320")) + if ((sensor == "Hans410") || (sensor == "Hans320")) { *strip = hmap->GetMaximumBin()-1; int max = hmap->GetMaximum(); cout << "Beetle channel with the maximum ADC count: " << *strip << endl; cout << "Maximum ADC count: " << max << endl; } - else if (sensorID == "ATLAS") + else if (sensor == "ATLAS") { *strip = hmap->GetMinimumBin()-1; int max = hmap->GetMinimum(); @@ -126,14 +126,14 @@ int right = hmap->GetBinContent(stripRight+1); // The +1 is necessary to take the number scheme of the histogram into account. cout << "Adjacent Beetle channel on the left: " << stripLeft << ", " << left << endl; cout << "Adjacent Beetle channel on the right: " << stripRight << ", " << right << endl; - if ((sensorID == "Hans410") || (sensorID == "Hans320")) + if ((sensor == "Hans410") || (sensor == "Hans320")) { if (left <= right) *direction = "right"; else *direction = "left"; } - else if (sensorID == "ATLAS") + else if (sensor == "ATLAS") if (left >= right) *direction = "right"; else diff --git a/Software/Tools/Masking.C b/Software/Tools/Masking.C new file mode 100644 index 0000000..5ea8b89 --- /dev/null +++ b/Software/Tools/Masking.C @@ -0,0 +1,84 @@ +//************************************************ +// Author: Federica Lionetto +// Created on: 05/12/2014 +//************************************************ + +/* + Masking is used to mask the Beetle channels close to the header and the Beetle channels that have problems. + + int maskBeetle1[NBeetle] and int maskBeetle2[NBeetle] are two global variables and have a 0/1 for each Beetle channel, where 0 stands for not masked and 1 stands for masked. + int chNotMaskedBeetle1 and int chNotMaskedBeetle2 are two global variables and represents the number of Beetle channels that are not masked. + + The masking is done according to the sensor under consideration, looking at the noise as a function of the Beetle channel for that particular sensor. + */ + +// Header guard. +#ifndef __MASKING_C_INCLUDED__ +#define __MASKING_C_INCLUDED__ + +#include "Par.C" + +int maskBeetle1[NBeetle]; +int maskBeetle2[NBeetle]; +int chNotMaskedBeetle1; +int chNotMaskedBeetle2; + +void Masking(string sensor); + +void Masking(string sensor) +{ + cout << "**************************************************" << endl; + cout << "Masking Beetle channels..." << endl; + cout << "**************************************************" << endl; + + // Initialization of the masking arrays. + for (int iChannel=0;iChannel=start_header) && (iChannel<=end_header)) || ((iChannel>=start_nextHeader) && (iChannel<=end_nextHeader)) || (iChannel%NSkip!=0)) + { + maskBeetle1[iChannel] = 1; + chNotMaskedBeetle1 -= 1; + } + if (((iChannel>=start_header) && (iChannel<=end_header)) || ((iChannel>=start_nextHeader) && (iChannel<=end_nextHeader)) || (iChannel%NSkip!=0)) + { + maskBeetle2[iChannel] = 1; + chNotMaskedBeetle2 -= 1; + } + } + + } + + cout << chNotMaskedBeetle1 << " not masked channels on Beetle 1" << endl; + cout << chNotMaskedBeetle2 << " not masked channels on Beetle 2" << endl; + + // Print masking for Beetle 1. + for (int iChannel=0;iChannelSetMarkerStyle(20); dcastyle->SetMarkerColor(kBlack); - dcastyle->SetMarkerSize(0.6); + dcastyle->SetMarkerSize(0.4); // title dcastyle->SetOptTitle(1); @@ -448,7 +448,7 @@ canvas->SetTicky(1); graph->Draw(option); graph->SetFillColor(38); - graph->SetMarkerSize(1); + graph->SetMarkerSize(0.4); graph->SetMarkerStyle(20); graph->SetMarkerColor(1); graph->SetLineWidth(2); @@ -477,7 +477,7 @@ canvas->SetTicky(1); graph->Draw(option); graph->SetFillColor(38); - graph->SetMarkerSize(1); + graph->SetMarkerSize(0.4); graph->SetMarkerStyle(20); graph->SetMarkerColor(1); graph->SetLineWidth(2); @@ -503,7 +503,7 @@ canvas->SetTicky(1); graph->Draw(option); graph->SetFillColor(38); - graph->SetMarkerSize(1); + graph->SetMarkerSize(0.4); graph->SetMarkerStyle(20); graph->SetMarkerColor(1); graph->SetLineWidth(2); @@ -533,7 +533,7 @@ canvas->SetTicky(1); graph->Draw(option); graph->SetFillColor(38); - graph->SetMarkerSize(1); + graph->SetMarkerSize(0.4); graph->SetMarkerStyle(20); graph->SetMarkerColor(1); graph->SetLineWidth(2); @@ -567,7 +567,7 @@ canvas->SetTicky(1); graph->Draw(option); graph->SetFillColor(38); - graph->SetMarkerSize(1); + graph->SetMarkerSize(0.4); graph->SetMarkerStyle(20); graph->SetMarkerColor(1); graph->SetLineWidth(2); @@ -597,7 +597,7 @@ canvas->SetTicky(1); graph->Draw(option); graph->SetFillColor(38); - graph->SetMarkerSize(1); + graph->SetMarkerSize(0.4); graph->SetMarkerStyle(20); graph->SetMarkerColor(1); graph->SetLineWidth(2);