SND@LHC Software
Loading...
Searching...
No Matches
sndSciFiBaseCut.cxx
Go to the documentation of this file.
1#include "sndSciFiBaseCut.h"
2
3#include <vector>
4
5#include "TClonesArray.h"
6#include "TChain.h"
7#include "sndScifiHit.h"
8
9namespace snd::analysis_cuts {
10
11 TClonesArray * sciFiBaseCut::scifiDigiHitCollection = 0;
12 TChain * sciFiBaseCut::tree = 0;
13 unsigned long int sciFiBaseCut::read_entry = -1;
14
15 std::vector<int> sciFiBaseCut::hits_per_plane_vertical = std::vector<int>(5, 0);
16 std::vector<int> sciFiBaseCut::hits_per_plane_horizontal = std::vector<int>(5, 0);
17
19 if (tree == 0){
20 tree = ch;
21 scifiDigiHitCollection = new TClonesArray("sndScifiHit", 3000);
22 tree->SetBranchAddress("Digi_ScifiHits", &scifiDigiHitCollection);
23 }
24 }
25
27 if (read_entry != tree->GetReadEntry()){
28 read_entry = tree->GetReadEntry();
29
30 // Clear hits per plane vectors
31 std::fill(hits_per_plane_vertical.begin(), hits_per_plane_vertical.end(), 0);
32 std::fill(hits_per_plane_horizontal.begin(), hits_per_plane_horizontal.end(), 0);
33
34 // Add valid hits to hits per plane vectors
35 sndScifiHit * hit;
36 TIter hitIterator(scifiDigiHitCollection);
37
38 while ( (hit = (sndScifiHit*) hitIterator.Next()) ){
39 if (hit->isValid()){
40 int sta = hit->GetStation();
41 if (hit->isVertical()){
43 } else {
45 }
46 }
47 }
48 }
49 }
50}
Int_t GetStation()
Definition sndScifiHit.h:31
bool isValid() const
Definition sndScifiHit.h:30
bool isVertical()
Definition sndScifiHit.h:32
static TClonesArray * scifiDigiHitCollection
static std::vector< int > hits_per_plane_vertical
static unsigned long int read_entry
static std::vector< int > hits_per_plane_horizontal