1 #ifndef IC_CRTDETSIMALG_CC
2 #define IC_CRTDETSIMALG_CC
10 std::pair<ChanData, AuxDetIDE> crtdat2) {
11 return ( crtdat1.first.ts < crtdat2.first.ts );
17 fNsim_m(0), fNsim_d(0), fNsim_c(0), fNchandat_m(0), fNchandat_d(0), fNchandat_c(0),
18 fNmissthr_c(0), fNmissthr_d(0), fNmissthr_m(0), fNmiss_strcoin_c(0), fNdual_m(0),
19 fHasFilledTaggers(
false), fRandEngine(engine)
48 fQ0 = p.get<
double>(
"Q0");
49 fQPed = p.get<
double>(
"QPed");
50 fQSlope = p.get<
double>(
"QSlope");
51 fQRMS = p.get<
double>(
"QRMS");
52 fQMax = p.get<uint16_t>(
"QMax");
70 fKbirks = p.get<
double>(
"Kbirks");
79 vector<pair<CRTData, vector<AuxDetIDE>>> dataCol;
82 throw cet::exception(
"CRTDetSimAlg") <<
"CreateData() called with empty taggers map!";
88 int ncombined_c=0, ncombined_m=0, ncombined_d=0;
89 int nmiss_lock_c=0, nmiss_lock_d=0, nmiss_lock_m=0;
90 int nmiss_dead_c=0, nmiss_dead_d=0, nmiss_dead_m=0;
91 int nmiss_opencoin_c = 0, nmiss_opencoin_d = 0;
96 int nhit_m=0, nhit_c=0, nhit_d=0;
97 int neve_m=0, neve_c=0, neve_d=0;
115 set<int> trackNHold = {};
116 set<int> layerNHold = {};
117 if((
int)trg.first==INT_MAX)
std::cout <<
"WARNING: bad mac5 found!" << std::endl;
118 bool minosPairFound =
false, istrig=
false;
119 vector<ChanData> passingData;
120 vector<AuxDetIDE> passingIDE;
121 uint64_t ttrig=0.0, ttmp=0.0;
123 size_t trigIndex = 0;
140 << trg.second.data.size() <<
" entries..." <<
'\n'
141 <<
" type: " << trg.second.type <<
'\n'
142 <<
" region: " << trg.second.reg <<
'\n'
143 <<
" layerID: " << *trg.second.layerid.begin() <<
'\n' << std::endl;
146 for (
size_t i=0; i< trg.second.data.size(); i++ ) {
150 chanTrigData = &(trg.second.data[0].first);
151 ttrig = chanTrigData->
ts;
152 trackNHold.insert(chanTrigData->
channel);
153 layerNHold.insert(trg.second.chanlayer[chanTrigData->
channel]);
154 passingData.push_back(*chanTrigData);
155 passingIDE.push_back(trg.second.data[0].second);
157 idetmp = passingIDE.back();
158 if(trg.second.type!=
'm')
163 chanTmpData = &(trg.second.data[i].first);
164 ttmp = chanTmpData->
ts;
165 idetmp = trg.second.data[i].second;
170 if ( layerNHold.size()==1 &&
175 chanTrigData = &(trg.second.data[trigIndex].first);
177 ttrig = chanTrigData->
ts;
182 trackNHold.insert(chanTrigData->
channel);
183 layerNHold.insert(trg.second.chanlayer[chanTrigData->
channel]);
184 passingData.push_back(*chanTrigData);
185 passingIDE.push_back(trg.second.data[trigIndex].second);
186 if(trg.second.type==
'c') nmiss_coin_c++;
187 if(trg.second.type==
'd') nmiss_coin_d++;
192 std::cout <<
"checking for coincidence..." << std::endl;
197 for (
auto trg2 :fTaggers) {
199 if( trg2.second.type!=
'm' ||
200 trg.second.modid == trg2.second.modid ||
201 trg.second.reg != trg2.second.reg ||
202 *trg2.second.layerid.begin() == *trg.second.layerid.begin())
207 for (
size_t j=0; j< trg2.second.data.size(); j++ ) {
208 uint64_t t2tmp = trg2.second.data[j].first.ts;
210 minosPairFound =
true;
220 if(!minosPairFound) {
222 std::cout <<
"MINOS pair NOT found! Skipping to next FEB..." << std::endl;
223 if(trg.second.data.size()==1)
continue;
225 chanTrigData = &(trg.second.data[trigIndex].first);
227 ttrig = chanTrigData->
ts;
232 trackNHold.insert(chanTrigData->
channel);
233 layerNHold.insert(trg.second.chanlayer[chanTrigData->
channel]);
234 passingData.push_back(*chanTrigData);
235 passingIDE.push_back(trg.second.data[trigIndex].second);
244 std::cout <<
"done checking coinceidence...moving on to latency effects..." << std::endl;
245 if(!minosPairFound && trg.second.type==
'm')
246 std::cout <<
"WARNING: !minosPairFound...should not see this message!" << std::endl;
259 passingData.push_back(*chanTmpData);
260 passingIDE.push_back(idetmp);
263 if (layerNHold.insert(trg.second.chanlayer[chanTmpData->
channel]).second
264 && trg.second.type !=
'm')
273 for(
size_t dat=0;
dat<passingData.size();
dat++) {
274 if(passingData[
dat].channel!=chanTmpData->
channel)
276 adctmp = passingData[
dat].adc;
277 adctmp += chanTmpData->
adc;
279 passingData[
dat].adc = adctmp;
280 passingIDE.push_back(idetmp);
285 switch (trg.second.type) {
286 case 'c' : ncombined_c++;
break;
287 case 'd' : ncombined_d++;
break;
288 case 'm' : ncombined_m++;
break;
292 else switch (trg.second.type) {
293 case 'c' : nmiss_lock_c++;
break;
294 case 'd' : nmiss_lock_d++;
break;
295 case 'm' : nmiss_lock_m++;
break;
300 else if ( i>0 && ttmp <= ttrig +
fDeadTime ) {
301 switch (trg.second.type) {
302 case 'c' : nmiss_dead_c++;
break;
303 case 'd' : nmiss_dead_d++;
break;
304 case 'm' : nmiss_dead_m++;
break;
317 std::cout <<
"creating CRTData product just after deadtime" <<
'\n'
318 <<
" event: " << eve <<
'\n'
319 <<
" mac5: " << trg.first <<
'\n'
320 <<
" FEB entry: " <<
event <<
'\n'
321 <<
" trig time: " << ttrig <<
'\n'
322 <<
" trig channel: " << chanTrigData->
channel <<
'\n'
323 <<
" passing data: " << std::endl;
324 for(
size_t i=0; i<passingData.size(); i++) {
326 <<
" index: " << i <<
'\n'
327 <<
" channel: " << passingData[i].channel <<
'\n'
328 <<
" t0: " << passingData[i].ts <<
'\n'
329 <<
" adc: " << passingData[i].adc << std::endl;
333 if(passingData.size()>passingIDE.size())
334 std::cout <<
"data/IDE size mismatch!" << passingData.size()-passingIDE.size() << std::endl;
336 dataCol.push_back(std::make_pair(
342 if (trg.second.type==
'c') {neve_c++; nhit_c+=passingData.size(); }
343 if (trg.second.type==
'd') {neve_d++; nhit_d+=passingData.size(); }
344 if (trg.second.type==
'm') {neve_m++; nhit_m+=passingData.size(); } }
347 chanTrigData = chanTmpData;
352 passingData.push_back(*chanTrigData);
353 passingIDE.push_back(idetmp);
354 trackNHold.insert(chanTrigData->
channel);
355 layerNHold.insert(trg.second.chanlayer[chanTmpData->
channel]);
356 minosPairFound =
false;
360 if (!(ttmp > ttrig +
fDeadTime) && i==trg.second.data.size()-1 && istrig) {
363 std::cout <<
"creating CRTData product at end of FEB events..." <<
'\n'
364 <<
" event: " << eve <<
'\n'
365 <<
" mac5: " << trg.first <<
'\n'
366 <<
" FEB entry: " <<
event <<
'\n'
367 <<
" trig time: " << ttrig <<
'\n'
368 <<
" trig channel: " << chanTrigData->
channel <<
'\n'
369 <<
" passing data: " << std::endl;
370 for(
size_t i=0; i<passingData.size(); i++) {
372 <<
" index: " << i <<
'\n'
373 <<
" channel: " << passingData[i].channel <<
'\n'
374 <<
" t0: " << passingData[i].ts <<
'\n'
375 <<
" adc: " << passingData[i].adc << std::endl;
383 if(passingData.size()>passingIDE.size())
384 std::cout <<
"data/IDE size mismatch! " << passingData.size()-passingIDE.size() << std::endl;
386 dataCol.push_back( std::make_pair(
390 std::cout <<
" ...success!" << std::endl;
392 if (trg.second.type==
'c') {neve_c++; nhit_c+=passingData.size(); }
393 if (trg.second.type==
'd') {neve_d++; nhit_d+=passingData.size(); }
394 if (trg.second.type==
'm') {neve_m++; nhit_m+=passingData.size(); }
399 if(
fUltraVerbose)
std::cout <<
" outside loop over FEB data entries...moving on to next FEB..." << std::endl;
404 std::cout <<
"|---------------------- CRTDetSim Summary ----------------------|" <<
'\n'
405 <<
" - - - EDeps from AuxDetIDE's - - -" <<
'\n'
406 <<
" CERN sim strip hits: " <<
fNsim_c <<
'\n'
407 <<
" MINOS sim strip hits: " <<
fNsim_m <<
'\n'
408 <<
" DC sim strip hits: " <<
fNsim_d <<
'\n' <<
'\n'
409 <<
" - - - Single Channel Threshold - - -" <<
'\n'
411 <<
" CERN channel signals > thresh: " <<
fNchandat_c <<
'\n'
412 <<
" MINOS channel signals > thresh: " <<
fNchandat_m <<
'\n'
413 <<
" both ends > thresh: " <<
fNdual_m <<
'\n'
414 <<
" DC channel signals > thresh: " <<
fNchandat_d <<
'\n'
416 <<
" CERN channel signals < thresh: " <<
fNmissthr_c <<
'\n'
417 <<
" MINOS channel signals < thresh: " <<
fNmissthr_m <<
'\n'
418 <<
" DC channel signals < thresh: " <<
fNmissthr_d <<
'\n' <<
'\n'
419 <<
" - - - System Specifc Coincidence Loss- - -" <<
'\n'
421 <<
" CERN open layer-layer: " << nmiss_opencoin_c <<
'\n'
422 <<
" DC open layer-layer: " << nmiss_opencoin_d <<
'\n'
423 <<
" CERN layer-layer: " << nmiss_coin_c <<
" (" << 100.0*nmiss_coin_c/
fNchandat_c <<
"%)" <<
'\n'
424 <<
" MINOS layer-layer: " << nmiss_coin_m <<
" (" << 100.0*nmiss_coin_m/
fNchandat_m <<
"%)" <<
'\n'
425 <<
" DC layer-layer: " << nmiss_coin_d <<
" (" << 100.0*nmiss_coin_d/
fNchandat_d <<
"%)" <<
'\n' <<
'\n'
426 <<
" - - - Front-End Electronics Effects - - -" <<
'\n'
427 <<
" CERN trackNHold loss: " << nmiss_lock_c <<
" (" << 100.0*nmiss_lock_c/
fNchandat_c <<
"%)" <<
'\n'
428 <<
" MINOS trackNHold loss: " << nmiss_lock_m <<
" (" << 100.0*nmiss_lock_m/
fNchandat_m <<
"%)" <<
'\n'
429 <<
" DC trackNHold loss: " << nmiss_lock_d <<
" (" << 100.0*nmiss_lock_d/
fNchandat_d <<
"%)" <<
'\n'
430 <<
" CERN combined: " << ncombined_c <<
" (" << 100.0*ncombined_c/
fNchandat_c <<
"%)" <<
'\n'
431 <<
" MINOS combined: " << ncombined_m <<
" (" << 100.0*ncombined_m/
fNchandat_m <<
"%)" <<
'\n'
432 <<
" DC combined: " << ncombined_d <<
" (" << 100.0*ncombined_d/
fNchandat_d <<
"%)" <<
'\n'
433 <<
" CERN deadTime loss: " << nmiss_dead_c <<
" (" << 100.0*nmiss_dead_c/
fNchandat_c <<
"%)" <<
'\n'
434 <<
" MINOS deadTime loss: " << nmiss_dead_m <<
" (" << 100.0*nmiss_dead_m/
fNchandat_m <<
"%)" <<
'\n'
435 <<
" DC deadTime loss: " << nmiss_dead_d <<
" (" << 100.0*nmiss_dead_d/
fNchandat_d <<
"%)" <<
'\n' <<
'\n'
436 <<
" - - - Passing Hits Pushed To Event - - -" <<
'\n'
437 <<
" CERN strip hits remaining: " << nhit_c+ncombined_c <<
" (" << 100.0*(nhit_c+ncombined_c)/
fNchandat_c <<
"%)" <<
'\n'
438 <<
" MINOS strip hits remaining: " << nhit_m+ncombined_m <<
" (" << 100.0*(nhit_m+ncombined_m)/
fNchandat_m <<
"%)" <<
'\n'
439 <<
" DC strip hits remaining: " << nhit_d+ncombined_d <<
" (" << 100.0*(nhit_d+ncombined_d)/
fNchandat_d <<
"%)" <<
'\n'
440 <<
" CERN channel signals generated: " << nhit_c <<
'\n'
441 <<
" MINOS channel signals generated: " << nhit_m <<
'\n'
442 <<
" DC channel signals generated: " << nhit_d <<
'\n'
443 <<
" CERN events: " << neve_c <<
'\n'
444 <<
" MINOS events: " << neve_m <<
'\n'
445 <<
" DC events: " << neve_d <<
'\n'
446 <<
" Total pushes to event: " << dataCol.size() << std::endl;
448 if(dataCol.size()>0) {
449 std::map<int,int>::iterator it =
fRegCounts.begin();
450 std::cout <<
'\n' <<
"FEB events per CRT region: " <<
'\n' << std::endl;
471 const uint32_t adid,
const uint32_t adsid,
const vector<sim::AuxDetIDE>& ides) {
473 art::ServiceHandle<geo::Geometry> geoService;
483 uint8_t mac5=UINT8_MAX, mac5dual=UINT8_MAX;
486 set<string> volNames = { adsGeo.
TotalVolume()->GetName() };
487 vector<vector<TGeoNode const*> > paths = geoService->FindAllVolumePaths(volNames);
490 for (
size_t inode=0; inode<paths.at(0).size(); inode++) {
491 path += paths.at(0).at(inode)->GetName();
492 if (inode < paths.at(0).size() - 1) {
497 TGeoManager* manager = geoService->ROOTGeoManager();
498 manager->cd(path.c_str());
499 TGeoNode* nodeStrip = manager->GetCurrentNode();
500 TGeoNode* nodeInner = manager->GetMother(1);
501 TGeoNode* nodeModule = manager->GetMother(2);
502 double origin[3] = {0, 0, 0};
504 double modulePosMother[3];
505 nodeModule->LocalToMaster(origin, modulePosMother);
508 double stripPosMother[3];
509 double stripPosModule[3];
510 nodeStrip->LocalToMaster(origin, stripPosMother);
511 nodeInner->LocalToMaster(stripPosMother,stripPosModule);
516 if (auxDetType ==
'c' || auxDetType ==
'd')
517 layid = (stripPosModule[1] > 0);
519 if (auxDetType ==
'm') {
521 if ( region.find(
"West")!=std::string::npos || region.find(
"East")!=std::string::npos ) {
522 layid = ( modulePosMother[0]>0 );
525 if ( region==
"South" || region==
"North" ) {
526 layid = ( modulePosMother[2]> 0 );
532 <<
"layid NOT SET!!!" <<
'\n'
533 <<
" ADType: " << auxDetType <<
'\n'
534 <<
" ADRegion: " << region;
538 for (
auto const& ide : ides ) {
540 if (auxDetType==
'c')
fNsim_c++;
541 if (auxDetType==
'd')
fNsim_d++;
542 if (auxDetType==
'm')
fNsim_m++;
546 double x = (ide.entryX + ide.exitX) / 2;
547 double y = (ide.entryY + ide.exitY) / 2;
548 double z = (ide.entryZ + ide.exitZ) / 2;
549 double world[3] = {
x,
y, z};
550 double svHitPosLocal[3];
551 double modHitPosLocal[3];
559 mf::LogError(
"CRT") <<
"HIT POINT OUTSIDE OF SENSITIVE VOLUME!" <<
'\n'
560 <<
" AD: " << adid <<
" , ADS: " << adsid <<
'\n'
561 <<
" Local position (x,y,z): ( " << svHitPosLocal[0]
562 <<
" , " << svHitPosLocal[1] <<
" , " << svHitPosLocal[2] <<
" )";
565 double dl = sqrt(pow(ide.entryX-ide.exitX,2)+pow(ide.entryY-ide.exitY,2)+pow(ide.entryZ-ide.exitZ,2));
566 double birksCorr = 1./(1+
fKbirks*ide.energyDeposited/dl);
570 double qr =
fUseEdep ? ide.energyDeposited /
fQ0 : 1.0;
571 if (auxDetType ==
'c'&& layid==0) qr *= 1.5;
575 double distToReadout =
abs( adsGeo.
HalfLength() - svHitPosLocal[2])*0.01;
576 double distToReadout2 =
abs(-adsGeo.
HalfLength() - svHitPosLocal[2])*0.01;
579 double npeExpected2 =
GetLongAtten(distToReadout2) * qr;
582 double abs0=1.0, abs1=1.0;
590 double npeExp0 = npeExpected * abs0;;
591 double npeExp1 = npeExpected * abs1;
592 double npeExp0Dual = npeExpected2 * abs0;
596 npeExp0 *= birksCorr;
597 npeExp1 *= birksCorr;
598 npeExp0Dual *= birksCorr;
602 if(npeExp0<0||npeExp1<0||npeExp0Dual<0)
603 mf::LogError(
"CRT") <<
"NEGATIVE PE!!!!!";
606 int npe0 = CLHEP::RandPoisson::shoot(&
fRandEngine, npeExp0);
607 int npe1 = CLHEP::RandPoisson::shoot(&
fRandEngine, npeExp1);
608 int npe0Dual = CLHEP::RandPoisson::shoot(&
fRandEngine, npeExp0Dual);
614 mf::LogError(
"CRTDetSim")
615 <<
"negative true time passed to time stamp generator!";
645 int channel0ID=0, channel1ID=0;
652 channel0ID = 2 * adsid + 0;
653 channel1ID = 2 * adsid + 1;
659 channel0ID = adsid/2 + 10*(changroup-1);
661 mac5dual = macs.second;
666 if (mac5==UINT8_MAX) mf::LogError(
"CRT") <<
"mac addrs not set!";
669 if (auxDetType==
'c') {
682 tagger.
data.push_back(
688 tagger.
data.push_back(
704 tagger.
data.push_back(
709 if (auxDetType==
'm') {
717 tagger.
data.push_back(
728 tagger.
data.push_back(
729 std::make_pair(
FillChanData(channel0ID,q0Dual,t0Dual),ide));
736 if (auxDetType ==
'c') {
740 if (auxDetType ==
'm') {
742 if( q0Dual < fQThresholdM && fCrtutils->NFeb(adid)==2)
fNmissthr_m++;
752 <<
"CRT HIT VOL " << (adGeo.
TotalVolume())->GetName() <<
"\n"
753 <<
"CRT HIT SENSITIVE VOL " << (adsGeo.
TotalVolume())->GetName() <<
"\n"
754 <<
"CRT HIT AuxDetID " << adid <<
" / AuxDetSensitiveID " << adsid <<
"\n"
755 <<
"CRT module type: " << auxDetType <<
" , CRT region: " << region <<
'\n'
756 <<
"CRT channel: " << channel0ID <<
" , mac5: " << (int)mac5 <<
'\n'
757 <<
"CRT HIT POS (world coords) " << x <<
" " << y <<
" " << z <<
"\n"
758 <<
"CRT STRIP POS (module coords) " << svHitPosLocal[0] <<
" " << svHitPosLocal[1] <<
" " << svHitPosLocal[2] <<
"\n"
759 <<
"CRT MODULE POS (region coords) " << modHitPosLocal[0] <<
" " << modHitPosLocal[1] <<
" "<< modHitPosLocal[2] <<
" " <<
"\n"
760 <<
"CRT layer ID: " << layid <<
"\n"
761 <<
"CRT distToReadout: " << distToReadout <<
", distToReadout2: " << distToReadout2 <<
", qr = " << qr <<
'\n'
762 <<
"CRT abs0: " << abs0 <<
" , abs1: " << abs1 <<
'\n'
763 <<
"CRT npeExpected: " << npeExpected <<
" , npeExpected2: " << npeExpected2 <<
'\n'
765 <<
"CRT npeSiPM0: " << npe0 <<
" , npeSiPM1: " << npe1 <<
" , npeSiPM0Dual: " << npe0Dual <<
'\n'
766 <<
"CRT charge q0: " << q0 <<
", q1: " << q1 <<
'\n'
768 <<
"CRT timing: tTrue: " << tTrue <<
", t0: " << t0 <<
", t1: " << t1 <<
", |t0-t1|: " <<
util::absDiff(t0,t1) <<
'\n'
770 <<
" recoT0-trueT = " << t0-tTrue <<
", recoT1-trueT = " << t1-tTrue <<
", recoT0Dual-trueT = " << t0Dual-tTrue <<
", recoT0-recoT0Dual = " << t0-t0Dual << std::endl;
781 double abs0=0.0, abs1=0.0;
785 double at0_c = 0.682976;
786 double at1_c = -0.0204477;
787 double at2_c = -0.000707564;
788 double at3_c = 0.000636617;
789 double at4_c = 0.000147957;
790 double at5_c = -3.89078e-05;
792 double at0_r = 0.139941;
793 double at1_r = 0.168238;
794 double at2_r = -0.0198199;
795 double at3_r = 0.000781752;
797 double at0_l = 8.78875;
798 double at1_l = 3.54602;
799 double at2_l = 0.595592;
800 double at3_l = 0.0449169;
801 double at4_l = 0.00127892;
804 if (
abs(pos) <= 5.5 ) {
805 abs0 = at5_c*pow(pos,5) + at4_c*pow(pos,4) + at3_c*pow(pos,3)
806 + at2_c*pow(pos,2) + at1_c*pos + at0_c;
807 abs1 = -1*at5_c*pow(pos,5) + at4_c*pow(pos,4) - at3_c*pow(pos,3)
808 + at2_c*pow(pos,2) - at1_c*pos + at0_c;
813 abs0 = at3_r*pow(pos,3) + at2_r*pow(pos,2) + at1_r*pos + at0_r;
814 abs1 = at4_l*pow(pos,4) - at3_l*pow(pos,3)
815 + at2_l*pow(pos,2) - at1_l*pos + at0_l;
820 abs0 = at4_l*pow(pos,4) + at3_l*pow(pos,3) \
821 + at2_l*pow(pos,2) + at1_l*pos + at0_l;
822 abs1 = -1*at3_r*pow(pos,3) + at2_r*pow(pos,2) - at1_r*pos + at0_r;
825 return std::make_pair(abs0,abs1);
837 double p0_m = 36.5425;
838 double p1_m = -6.3895;
839 double p2_m = 0.3742;
841 pes = p2_m * pow(dist,2) + p1_m * dist + p0_m;
852 double t0,
float npeMean,
float r)
866 double tDelay = CLHEP::RandGauss::shoot(&
fRandEngine, tDelayMean, tDelayRMS);
874 double t = t0 + tProp + tDelay;
880 <<
"CRT TIMING: t0=" << t0
881 <<
", tDelayMean=" << tDelayMean <<
", tDelayRMS=" << tDelayRMS
882 <<
", tDelay=" << tDelay <<
", tDelay(interp)="
883 << tDelay <<
", tProp=" << tProp <<
", t=" << t
884 <<
", ticks=" << clock.
Ticks() <<
"\n";
920 for(
size_t chan=0; chan<64; chan++) {
921 dat.
fAdc[chan] = adc[chan];
939 for(
int chan=0; chan<64; chan++)
941 for(
auto const&
dat : data) {
942 if(
dat.channel<0 ||
dat.channel>63){
943 std::cout <<
"ChanData channel out of bounds!" << std::endl;
946 arr[
dat.channel] =
dat.adc;
uint8_t fMac5
FEB address following numbering convention common for both data and MC.
int ADToChanGroup(size_t adid)
process_name opflash particleana ie ie ie z
map< int, int > chanlayer
double fTDelayRMSGausSigma
Time delay RMS fit: Gaussian width.
double fTDelayNorm
Time delay fit: Gaussian normalization.
double fLayerCoincidenceWindowM
Time window for two layer coincidence between MINOS modules [ns].
pair< double, double > GetTransAtten(const double pos)
double fLayerCoincidenceWindowC
Time window for two layer coincidence in a CERN module [ns].
process_name opflash particleana ie x
bool fApplyCoincidenceM
Whether or not to apply coincidence between hits in adjacent layers.
double fDeadTime
Dead Time inherent in the front-end electronics.
void FillAdcArr(const vector< ChanData > &data, uint16_t arr[32])
vector< pair< ChanData, AuxDetIDE > > data
uint16_t fQThresholdC
ADC charge threshold for CERN system [ADC].
double fStripCoincidenceWindow
Time window for two-fiber coincidence [ns].
AuxDetSensitiveGeo const & SensitiveVolume(size_t sv) const
uint16_t fQThresholdD
ADC charge threshold for DC system [ADC].
double fQPed
ADC offset for the single-peak peak mean [ADC].
void WorldToLocal(const double *world, double *auxdet) const
Transform point from world frame to local auxiliary detector frame.
uint16_t fQThresholdM
ADC charge threshold for MINOS system [ADC].
uint32_t fEntry
Hit index for given FEB in an event (starts from 0 for each event).
double fQ0
Average energy deposited for mips in 1cm for charge scaling [GeV].
constexpr int Ticks() const noexcept
Current clock tick (that is, the number of tick Time() falls in).
double HalfWidth1() const
double fPropDelayError
Delay in pulse arrival time, uncertainty [ns/m].
ChanData FillChanData(int channel, uint16_t adc, uint64_t ts)
double fTDelayOffset
Time delay fit: Gaussian baseline offset.
int AuxDetRegionNameToNum(string reg)
double fTResInterpolator
Interpolator time resolution [ns].
double fTDelayRMSExpScale
Time delay RMS fit: Exponential scale.
constexpr ElecClock WithTime(double const time) const noexcept
BEGIN_PROLOG triggeremu_data_config_icarus settings PMTADCthresholds sequence::icarus_stage0_multiTPC_TPC physics sequence::icarus_stage0_EastHits_TPC physics sequence::icarus_stage0_WestHits_TPC physics producers purityana0 caloskimCalorimetryCryoE physics caloskimCalorimetryCryoW physics path
double fTDelaySigma
Time delay fit: Gaussian width.
double HalfHeight() const
uint16_t fQMax
ADC saturation value [ADC].
double fBiasTime
Hard cut off for follow-up hits after primary trigger to bias ADC level.
string GetRegionNameFromNum(int num)
process_name opflash particleana ie ie y
bool fApplyCoincidenceC
Whether or not to apply coincidence between hits in adjacent layers.
map< uint8_t, Tagger > fTaggers
bool fUseBirks
Whether or not to apply Birks' quenching to light output.
double fQSlope
Slope in mean ADC / Npe [ADC].
vector< pair< CRTData, vector< AuxDetIDE > > > CreateData()
double fKbirks
Birks' constant [cm/MeV].
CRTDetSimAlg(fhicl::ParameterSet const &p, CLHEP::HepRandomEngine &fRandEngine)
double fQRMS
ADC single-pe spectrum width [ADC].
const TGeoVolume * TotalVolume() const
auto end(FixedBins< T, C > const &) noexcept
double fGlobalT0Offset
Time delay fit: Gaussian normalization.
Single hit (self trigger) of a CRT board.
pair< uint8_t, uint8_t > ADToMac(size_t adid)
CRTData FillCRTData(uint8_t mac, uint32_t entry, uint64_t t0, uint64_t ts1, uint16_t adc[32])
double fPropDelay
Delay in pulse arrival time [ns/m].
ElecClock const & TriggerClock() const noexcept
Borrow a const Trigger clock with time set to Trigger time [us].
bool fApplyStripCoinC
Whether or not to apply coincence between fibers in a strip (c modules only)
double fTDelayRMSGausShift
Time delay RMS fit: Gaussian x shift.
double fTDelayShift
Time delay fit: Gaussian x shift.
double fTDelayRMSGausNorm
Time delay RMS fit: Gaussian normalization.
map< int, int > fRegCounts
char GetAuxDetType(size_t adid)
bool TimeOrderCRTData(std::pair< ChanData, AuxDetIDE > crtdat1, std::pair< ChanData, AuxDetIDE > crtdat2)
constexpr auto absDiff(A const &a, B const &b)
Returns the absolute value of the difference between two values.
double fTDelayRMSExpShift
Time delay RMS fit: Exponential x shift.
string GetAuxDetRegion(size_t adid)
double fTDelayRMSExpNorm
Time delay RMS fit: Exponential normalization.
uint16_t fAdc[64]
ADC readout for each channel. CAEN (Bern) CRT FEBs use only indices 0-31.
void FillTaggers(detinfo::DetectorClocksData const &clockData, const uint32_t adid, const uint32_t adsid, const vector< AuxDetIDE > &ides)
CLHEP::HepRandomEngine & fRandEngine
const TGeoVolume * TotalVolume() const
Contains all timing reference information for the detector.
constexpr double dist(const TReal *x, const TReal *y, const unsigned int dimension)
void reconfigure(fhicl::ParameterSet const &p)
MC truth information to make RawDigits and do back tracking.
void WorldToLocal(const double *world, double *auxdet) const
Transform point from world frame to local auxiliary detector frame.
CRTCommonUtils * fCrtutils
double GetLongAtten(const double dist)
double HalfLength() const
bool fUseEdep
Use the true G4 energy deposited, assume mip if false.
Class representing the time measured by an electronics clock.
double fLayerCoincidenceWindowD
Time window for two layer coincidence in a DC module [ns].
uint64_t GetChannelTriggerTicks(detinfo::ElecClock &clock, double t0, float npeMean, float r)
BEGIN_PROLOG could also be cout
uint64_t fTs0
Absolute hit timestamp [ns].
bool fApplyCoincidenceD
Whether or not to apply coincidence between hits in adjacent layers.
constexpr Point origin()
Returns a origin position with a point of the specified type.
uint64_t fTs1
Trigger time, not well defined as of Apr 14, 2021.