StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
electron_tree_maker.C
1 //Contrary to its name, this code does not make histograms. Rather, it skims the trees looking for electrons
2 //and writes them to a slimmer tree
3 #include <iostream>
4 #include <fstream>
5 #include <set>
6 #include <pair>
7 #include <map>
8 
9 using namespace std;
10 
11 void electron_tree_maker(const char* file_list="ctest3.list",const char* skimfile="electronskimfile.root")
12 {
13  gROOT->Macro("LoadLogger.C");
14  gROOT->Macro("loadMuDst.C");
15  gSystem->Load("StTpcDb");
16  gSystem->Load("StDaqLib");
17  gSystem->Load("StDetectorDbMaker");
18  gSystem->Load("St_db_Maker");
19  gSystem->Load("StDbUtilities");
20  gSystem->Load("StEmcRawMaker");
21  gSystem->Load("StMcEvent");
22  gSystem->Load("StMcEventMaker");//***
23  gSystem->Load("StEmcSimulatorMaker");//***
24  gSystem->Load("StEmcADCtoEMaker");
25  gSystem->Load("StEpcMaker");
26  gSystem->Load("StDbBroker");
27  gSystem->Load("StEmcUtil");
28  gSystem->Load("StAssociationMaker");
29  gSystem->Load("StEmcTriggerMaker");
30  gSystem->Load("StTriggerUtilities");
31  gSystem->Load("StEmcOfflineCalibrationMaker");
32 
33  //chain all input files together
34  char file[300];
35  TChain* calib_tree = new TChain("calibTree");
36  ifstream filelist(file_list);
37  while(1){
38  filelist >> file;
39  if(!filelist.good()) break;
40  cout<<file<<endl;
41  calib_tree->Add(file);
42  }
43 
44  char* dbtime = "2009-03-28 00:00:00";
45  StEmcOfflineCalibrationElectronAnalyzer* ana = new StEmcOfflineCalibrationElectronAnalyzer;
46 
47  //2011
48  /*ana->HTtrigs.push_back(320500);
49  ana->HTtrigs.push_back(320501);
50  ana->HTtrigs.push_back(320503);
51  ana->HTtrigs.push_back(320504);
52  ana->HTtrigs.push_back(320514);
53  ana->HTtrigs.push_back(320524);
54  ana->HTtrigs.push_back(330501);
55  ana->HTtrigs.push_back(330503);
56  ana->HTtrigs.push_back(330524);
57  ana->HTtrigs.push_back(320801);
58  ana->HTtrigs.push_back(330801);
59 
60  ana->TOFtrigs.push_back(320300);
61  ana->TOFtrigs.push_back(320301);
62  ana->TOFtrigs.push_back(320302);
63  ana->TOFtrigs.push_back(320311);
64  ana->TOFtrigs.push_back(330311);
65  ana->TOFtrigs.push_back(330322);
66  ana->TOFtrigs.push_back(320312);
67  ana->TOFtrigs.push_back(320322);*/
68 
69  //2009
70  ana->HTtrigs.push_back(240530);
71  ana->HTtrigs.push_back(240540);
72  ana->HTtrigs.push_back(240550);
73  ana->HTtrigs.push_back(240560);
74  ana->HTtrigs.push_back(240570);
75 
76 
77  /*2008
78  ana->HTtrigs.push_back(220500);
79  ana->HTtrigs.push_back(220510);
80  ana->HTtrigs.push_back(220520);
81  */
82  /*2006
83  ana->HTtrigs.push_back(117211);
84  ana->HTtrigs.push_back(117212);
85  ana->HTtrigs.push_back(117611);
86  ana->HTtrigs.push_back(117821);
87  ana->HTtrigs.push_back(127212);
88  ana->HTtrigs.push_back(127213);
89  ana->HTtrigs.push_back(127611);
90  ana->HTtrigs.push_back(127821);
91  ana->HTtrigs.push_back(137213);
92  ana->HTtrigs.push_back(137611);
93  ana->HTtrigs.push_back(137821);
94  */
95  ana->analyzeTree(calib_tree,skimfile,dbtime);
96 
97 
98 }