SND@LHC Software
Loading...
Searching...
No Matches
sndDSActivityCut.cxx
Go to the documentation of this file.
1#include "sndDSActivityCut.h"
2
3#include "TClonesArray.h"
4#include "TChain.h"
5#include "MuFilterHit.h"
6
7#include <vector>
8#include <numeric>
9
10namespace snd::analysis_cuts {
11
13 cutName = "If there are DS hits, all US planes must be hit";
14
15 shortName = "NUSPlanesHitIfDSHit";
16 nbins = std::vector<int>{5};
17 range_start = std::vector<double>{0};
18 range_end = std::vector<double>{5};
19 plot_var = std::vector<double>{-1};
20
21 }
22
24 MuFilterHit * hit;
25 TIter hitIterator(muFilterDigiHitCollection);
26
27 bool ds = false;
28 std::vector<bool> us = std::vector<bool>(5, false);
29
30 while ( (hit = (MuFilterHit*) hitIterator.Next()) ){
31 if (hit->GetSystem() == 2) {
32 us[hit->GetPlane()] = true;
33 } else if (hit->GetSystem() == 3) {
34 ds = true;
35 }
36 }
37
38 if (not ds) {
39 plot_var[0] = -1;
40 return false;
41 }
42
43 plot_var[0] = std::accumulate(us.begin(), us.end(), 0);
44 if (plot_var[0] == 5) return true;
45 return false;
46 }
47}
int GetPlane()
Definition MuFilterHit.h:42
int GetSystem()
Definition MuFilterHit.h:41
static TClonesArray * muFilterDigiHitCollection
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