SND@LHC Software
Loading...
Searching...
No Matches
sndUSQDCCut.cxx
Go to the documentation of this file.
1#include "sndUSQDCCut.h"
2
3#include "TClonesArray.h"
4#include "TChain.h"
5#include "MuFilterHit.h"
6#include "TString.h"
7
8#include <vector>
9#include <map>
10#include <numeric>
11
12namespace snd::analysis_cuts {
13
14 USQDCCut::USQDCCut(float threshold, TChain * ch) : MuFilterBaseCut(ch) {
15 qdc_threshold = threshold;
16 cutName = "Total US QDC > "+std::to_string(qdc_threshold);
17
18 shortName = "USQDC";
19 nbins = std::vector<int>{100};
20 range_start = std::vector<double>{0};
21 range_end = std::vector<double>{10000};
22 plot_var = std::vector<double>{-1};
23 }
24
26 MuFilterHit * hit;
27 TIter hitIterator(muFilterDigiHitCollection);
28
29 float totQDC = 0.;
30
31 bool ds = false;
32 std::vector<bool> us = std::vector<bool>(5, false);
33
34 while ( (hit = (MuFilterHit*) hitIterator.Next()) ){
35 if (hit->GetSystem() == 2) {
36 for (const auto& [key, value] : hit->GetAllSignals()) {
37 totQDC += value;
38 }
39 }
40 }
41 plot_var[0] = totQDC;
42 if (totQDC >= qdc_threshold) return true;
43 return false;
44 }
45}
int GetSystem()
Definition MuFilterHit.h:41
std::map< Int_t, Float_t > GetAllSignals(Bool_t mask=kTRUE, Bool_t positive=kTRUE)
static TClonesArray * muFilterDigiHitCollection
USQDCCut(float threshold, TChain *ch)
std::vector< double > plot_var
Definition sndBaseCut.h:14
std::vector< double > range_end
Definition sndBaseCut.h:13
std::vector< double > range_start
Definition sndBaseCut.h:12
std::vector< int > nbins
Definition sndBaseCut.h:11