1 #ifndef CRTMergePreProcessTrees_CXX
2 #define CRTMergePreProcessTrees_CXX
22 int main(
int argc,
char *argv[]) {
24 cout <<
"Opening file for reading with name, '" << argv[1] <<
"'" << endl;
26 cout <<
"Opening new file for writing with name, '" << argv[2] <<
"'" << endl;
43 TTree* fAnaTree =
new TTree(
"anaTree",
"calibrated charge, trigger 'flag', and time ordered entries");
45 fAnaTree->Branch(
"mac5", &fMac5,
"mac5/b");
46 fAnaTree->Branch(
"pe", fPE,
"pe[32]/F");
47 fAnaTree->Branch(
"active", fActive,
"active[32]/O");
48 fAnaTree->Branch(
"maxChan", &fMaxChan,
"maxChan/b");
49 fAnaTree->Branch(
"maxPE", &fMaxPE,
"maxPE/F");
50 fAnaTree->Branch(
"totPE", &fTotPE,
"totPE/F");
51 fAnaTree->Branch(
"nAbove", &fNChanAbove,
"nAbove/b");
52 fAnaTree->Branch(
"above", fAbove,
"above[32]/O");
53 fAnaTree->Branch(
"isNoise", &fIsNoise,
"isNoise/O");
54 fAnaTree->Branch(
"region", &fRegion,
"region/I");
55 fAnaTree->Branch(
"layer", &fLayer,
"layer/I");
56 fAnaTree->Branch(
"t0", &fT0,
"t0/l");
57 fAnaTree->Branch(
"pollRate", &fPollRate,
"pollRate/F");
58 fAnaTree->Branch(
"instRate", &fInstRate,
"instRate/F");
60 TFile fin(argv[1],
"READ");
61 TTree* intree = (TTree*)fin.FindObjectAny(
"anaTree");
66 std::cout <<
"done sorting " << sortedToRaw->size() <<
" entries" << std::endl;
69 TFile
fout(argv[2],
"RECREATE");
71 std::cout <<
"filling new, sorted tree..." << std::endl;
73 for(
size_t i=0; i<nentries; i++) {
76 std::cout << 100.0*i/nentries <<
" % complete" << std::endl;
78 cpt.
Load(sortedToRaw->at(i));
92 for(
size_t ch=0; ch<32; ch++){
94 fAbove[ch] = cpt.
Above(ch);
95 fActive[ch] = cpt.
Active(ch);
double std(const std::vector< short > &wf, const double ped_mean, size_t start, size_t nsample)
void Load(size_t ientry) const
size_t GetNEntries() const
bool Above(uint8_t chan) const
int main(int argc, char **argv)
bool Active(uint8_t chan) const
float PE(uint8_t chan) const
BEGIN_PROLOG could also be cout
const map< size_t, size_t > * GetOrderedToRawMap()
uint8_t NChanAbove() const