-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathConstructEng_old.C
45 lines (37 loc) · 1.2 KB
/
ConstructEng_old.C
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
#include<vector>
#include<string>
TH2D* ConstructEng( TFileCollection* fc )
{
gSystem->Load("./libTXPConfig.so");
TXPConfig* Channel = new TXPConfig("./XPConfig.txt");
TH2D* engMat = new TH2D("engMat", "Energy Matrix",
100, 0, 100,
30000, 0, 10000);
// Load Lst2RootTree's into chain
TChain* pChain = new TChain("Lst2RootTree");
pChain->AddFileInfoList( fc->GetList() );
TTreeReader TreeR(pChain);
TTreeReaderValue<int> energy(TreeR, "energy");
TTreeReaderValue<short> adc(TreeR, "adc");
TTreeReaderValue<int> multiplicity(TreeR, "multiplicity");
// Array for holding all energies in coincidence
bool vito = false;
printf("Constructing energy matrix\n");
while ( TreeR.Next() ) {
//if( *multiplicity > 1 ) // no crosstalk
// continue;
if ( *energy < 2 )
continue;
engMat->Fill(
*adc,
Channel->GetEnergy( *energy, *adc ) );
}
delete Channel;
delete pChain;
return engMat;
}
TH2D* ConstructEng( std::string TFileList )
{
TFileCollection* fc = new TFileCollection( "RootFileList", "", TFileList.c_str() );
return ConstructEng( fc );
}