Skip to content

Commit b7eb6c4

Browse files
authored
Update PTBAnalysis_module.cc
Cosmetic changes; Also added new ptb_#lt_unmask_timestamp to keep track of timestamp when multiple LLTs or HLTs
1 parent 8383e90 commit b7eb6c4

1 file changed

Lines changed: 12 additions & 2 deletions

File tree

sbndcode/PTBAna/PTBAnalysis_module.cc

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,8 @@ class sbnd::ptb::PTBAnalysis : public art::EDAnalyzer {
6868

6969
std::vector<uint64_t> _ptb_hlt_trigger;
7070
std::vector<uint64_t> _ptb_hlt_timestamp;
71+
std::vector<uint64_t> _ptb_hlt_unmask_timestamp;
72+
std::vector<uint64_t> _ptb_llt_unmask_timestamp;
7173
std::vector<int> _ptb_hlt_trunmask;
7274
std::vector<uint64_t> _ptb_llt_trigger;
7375
std::vector<uint64_t> _ptb_llt_timestamp;
@@ -124,6 +126,8 @@ sbnd::ptb::PTBAnalysis::PTBAnalysis(fhicl::ParameterSet const& p)
124126
fTree->Branch("ptb_hlt_trigger", "std::vector<uint64_t>", &_ptb_hlt_trigger);
125127
fTree->Branch("ptb_hlt_trunmask", "std::vector<int>", &_ptb_hlt_trunmask);
126128
fTree->Branch("ptb_hlt_timestamp", "std::vector<uint64_t>", &_ptb_hlt_timestamp);
129+
fTree->Branch("ptb_hlt_unmask_timestamp", "std::vector<uint64_t>", &_ptb_hlt_unmask_timestamp);
130+
fTree->Branch("ptb_llt_unmask_timestamp", "std::vector<uint64_t>", &_ptb_llt_unmask_timestamp);
127131
fTree->Branch("ptb_llt_trigger", "std::vector<uint64_t>", &_ptb_llt_trigger);
128132
fTree->Branch("ptb_chStatus_timestamp", "std::vector<uint64_t>", &_ptb_chStatus_timestamp);
129133
fTree->Branch("ptb_chStatus_beam", "std::vector<uint64_t>", &_ptb_chStatus_beam);
@@ -516,6 +520,7 @@ void sbnd::ptb::PTBAnalysis::AnalysePTBs(std::vector<art::Ptr<raw::ptb::sbndptb>
516520
_ptb_hlt_trigger.resize(nHLTs);
517521
_ptb_hlt_timestamp.resize(nHLTs);
518522
_ptb_hlt_trunmask.resize(nHLTs);
523+
_ptb_hlt_unmask_timestamp.resize(nHLTs);
519524

520525

521526
unsigned hlt_i = 0; //For multiple upbits in trigger words for unmasking
@@ -545,17 +550,19 @@ void sbnd::ptb::PTBAnalysis::AnalysePTBs(std::vector<art::Ptr<raw::ptb::sbndptb>
545550
}
546551

547552
if (numOfTrig ==1){
553+
_ptb_hlt_unmask_timestamp[hlt_i] = _ptb_hlt_timestamp[h_i-1];
548554
_ptb_hlt_trunmask[hlt_i] = upBit[0];
549555
hlt_i++;
550556
}//End of if statement for single upbit
551557

552558
else if (numOfTrig > 1){
553559
nHLTs += (numOfTrig -1);
554-
_ptb_hlt_timestamp.resize(nHLTs);
560+
_ptb_hlt_unmask_timestamp.resize(nHLTs);
555561
_ptb_hlt_trunmask.resize(nHLTs);
556562

557563
for (int mult =0; mult < numOfTrig; mult++){
558564
_ptb_hlt_trunmask[hlt_i] = upBit[mult];
565+
_ptb_hlt_unmask_timestamp[hlt_i] = _ptb_hlt_timestamp[h_i-1];
559566
hlt_i++;
560567
} //End of loop over multiple upbits
561568
} //End of else statement for multiple triggers
@@ -581,6 +588,7 @@ void sbnd::ptb::PTBAnalysis::AnalysePTBs(std::vector<art::Ptr<raw::ptb::sbndptb>
581588
_ptb_llt_trigger.resize(nLLTs);
582589
_ptb_llt_timestamp.resize(nLLTs);
583590
_ptb_llt_trunmask.resize(nLLTs);
591+
_ptb_llt_unmask_timestamp.resize(nHLTs);
584592

585593
unsigned llt_i = 0; //For ptb_llt_trunmask and perevent, includes the multiples with multiple upbits per word
586594
unsigned l_i=0; //For ptb_llt_trigger, records only unique words
@@ -611,16 +619,18 @@ void sbnd::ptb::PTBAnalysis::AnalysePTBs(std::vector<art::Ptr<raw::ptb::sbndptb>
611619

612620

613621
if (numOfTrig ==1){
622+
_ptb_llt_unmask_timestamp[llt_i] = _ptb_llt_timestamp[h_i-1];
614623
_ptb_llt_trunmask[llt_i] = upBit[0];
615624
llt_i++;
616625
} //End of if statement for single triggers
617626

618627
else if (numOfTrig > 1){
619628
nLLTs += (numOfTrig -1);
620-
_ptb_llt_timestamp.resize(nLLTs);
629+
_ptb_llt_unmask_timestamp.resize(nLLTs);
621630
_ptb_llt_trunmask.resize(nLLTs);
622631

623632
for (int mult =0; mult < numOfTrig; mult++){
633+
_ptb_llt_unmask_timestamp[llt_i] = _ptb_llt_timestamp[h_i-1];
624634
_ptb_llt_trunmask[llt_i] = upBit[mult];
625635
llt_i++;
626636
} //End of loop over multiple upBits

0 commit comments

Comments
 (0)