17 m_removeLowest = 0.05;
18 m_removeHighest = 0.25;
27 cout <<
"ElectronInterface: setting up from " << configfile << endl;
29 std::ifstream input(configfile.c_str());
31 std::string varname, vartype, line;
32 while( std::getline(input, line) ){
35 line.erase( std::find( line.begin(), line.end(),
'#' ), line.end() );
36 if( line.empty() )
continue;
39 std::istringstream iss(line);
43 if( vartype ==
"mcFlag" ){
47 else if( vartype ==
"type" ){
51 else if( vartype ==
"fit" ){
55 else if( vartype ==
"constfile" ){
56 iss >> m_constfilename;
59 else if( vartype ==
"lowest" ){
60 iss >> m_removeLowest;
63 else if( vartype ==
"highest" ){
64 iss >> m_removeHighest;
67 else if( vartype !=
"electron" ){
68 std::cout <<
"ElectronInterface: ERROR: unknown particle type " << vartype <<
" - this line will not be read" << endl;
74 if( varname ==
"filename")
76 else if( varname ==
"nevents")
78 else if( varname ==
"docabins")
80 else if( varname ==
"upperdoca")
82 else if( varname ==
"lowerdoca")
84 else if( varname ==
"bgbins")
86 else if( varname ==
"upperp"){
88 m_upperbg = m_upperbg/Widget::melectron;
90 else if( varname ==
"lowerp"){
92 m_lowerbg = m_lowerbg/Widget::melectron;
94 else if( varname ==
"entabins")
96 else if( varname ==
"upperenta")
98 else if( varname ==
"lowerenta")
100 else if( varname ==
"costhbins")
103 std::cout <<
"ElectronInterface: ERROR: unknown variable type " << vartype <<
" - this line will not be read" << endl;
108 std::cout <<
"ElectronInterface: Done parsing configuration file..." << endl;
114 m_filename = newfilename;
121 std::cout <<
"ElectronInterface: generating electron sample..." << std::endl;
123 TFile* outfile =
new TFile(outfilename,
"RECREATE");
130 m_filename = outfilename;
140 std::cout <<
"ElectronInterface: getting run gains..." << std::endl;
142 TFile* outfile =
new TFile(outfilename,
"RECREATE");
144 TFile* testfile =
new TFile(m_filename);
145 if( testfile->GetListOfKeys()->IsEmpty() ){
146 cout <<
"\t No electron sample" << endl;
152 ElectronCalibration ecalib(m_filename, m_constfilename, m_mcFlag, m_type, m_fits, m_docabins, m_upperdoca, m_lowerdoca, m_entabins, m_upperenta, m_lowerenta, m_costhbins);
162 std::cout <<
"WidgetInterface: getting two dimensional correction..." << std::endl;
164 TFile* outfile =
new TFile(outfilename,
"RECREATE");
166 TFile* testfile =
new TFile(m_filename);
167 if( testfile->GetListOfKeys()->IsEmpty() ){
168 cout <<
"\t No electron sample" << endl;
174 ElectronCalibration ecalib(m_filename, m_constfilename, m_mcFlag, m_type, m_fits, m_docabins, m_upperdoca, m_lowerdoca, m_entabins, m_upperenta, m_lowerenta, m_costhbins);
183 std::cout <<
"WidgetInterface: doing electron saturation correction..." << std::endl;
185 TFile* outfile =
new TFile(outfilename,
"RECREATE");
187 TFile* testfile =
new TFile(m_filename);
188 if( testfile->GetListOfKeys()->IsEmpty() ){
189 cout <<
"\t No electron sample" << endl;
195 ElectronCalibration ecalib(m_filename, m_constfilename, m_mcFlag, m_type, m_fits, m_docabins, m_upperdoca, m_lowerdoca, m_entabins, m_upperenta, m_lowerenta, m_costhbins);
204 std::cout <<
"WidgetInterface: applying electron corrections..." << std::endl;
206 TFile* outfile =
new TFile(outfilename,
"RECREATE");
208 TFile* testfile =
new TFile(m_filename);
209 if( testfile->GetListOfKeys()->IsEmpty() ){
210 cout <<
"\t No electron sample" << endl;
void fitRunGains(TFile *outfile)
void TwoDCorrection(TFile *outfile)
void plotRunGains(TString filename)
void SaturationCorrection(TFile *oufile)
void process(TFile *outfile)
void generateEvents(TFile *outfile)
void SetupFromConfigFile(std::string configfile)
void RunGains(TString outfilename)
void ApplyCorrections(TString outfile)
void SaturationCorrection(TString outfilename)
void SetFileName(TString newfilename)
void TwoDCorrection(TString outfilename)
void GenerateSample(TString outfile)