84 std::cout << std::endl;
85 std::cout << std::endl;
86 std::cout <<
"--- CaloHadDMCoeffCheck::process() --- " << std::endl;
128 std::cout <<
"CaloHadDMCoeffCheck::process -> Error! No entries in DeadMaterialTree." << std::endl;
132 std::vector<std::vector<std::vector<CaloHadDMCoeffFit::PrepData *> > > ereco;
133 std::vector<std::vector<std::vector<CaloHadDMCoeffFit::PrepData *> > > etrue;
137 for(
int i_area=0; i_area<nArea; i_area++){
140 for(
int i_eta=0; i_eta<
m_netabin; i_eta++){
154 std::cout <<
"CaloHadDMCoeffCheck::process() -> Info. First loop to find histogram limits " << std::endl;
156 if(i_ev%10000==0) std::cout <<
" i_ev: " << i_ev <<
" '" << ((TChain *)
m_data->
fChain)->GetFile()->GetName() <<
"'" << std::endl;
158 std::cout <<
"CaloHadDMCoeffCheck::process() -> Warning! Unknown particle energy " <<
m_data->
m_mc_ener << std::endl;
164 bool GoodClusterFound(
false);
166 HepLorentzVector hlv_pion(1,0,0,1);
169 HepLorentzVector hlv_cls(1,0,0,1);
171 double r = hlv_pion.angle(hlv_cls.vect());
176 GoodClusterFound =
true;
181 if(!GoodClusterFound)
continue;
188 if(mc_etabin <0 || mc_etabin >=
m_netabin || mc_enerbin <0 || mc_enerbin >=
m_nlogenerbin || mc_phibin!=0)
continue;
191 std::vector<std::vector<double > > engDmReco;
193 std::vector<double > engDmRecSumClus;
194 std::vector<double > engDmTrueSumClus;
195 engDmRecSumClus.resize(nArea, 0.0);
196 engDmTrueSumClus.resize(nArea, 0.0);
199 engDmRecSumClus[i_area] += engDmReco[i_cls][i_area];
206 ereco[i_area][mc_etabin][mc_enerbin]->add(engDmRecSumClus[i_area]);
207 etrue[i_area][mc_etabin][mc_enerbin] ->
add(engDmTrueSumClus[i_area]);
218 for(
int i_area=0; i_area<nArea; i_area++){
221 for(
int i_eta=0; i_eta<
m_netabin; i_eta++){
225 float elimreco = ereco[i_area][i_eta][i_ener]->m_aver + 5.*sqrt(ereco[i_area][i_eta][i_ener]->m_rms);
226 float elimtrue = etrue[i_area][i_eta][i_ener]->m_aver + 5.*sqrt(etrue[i_area][i_eta][i_ener]->m_rms);
227 if(elimreco <=0.0) elimreco = 1.0;
228 if(elimtrue <=0.0) elimtrue = 1.0;
230 sprintf(
hname,
"h2_etrue_vs_ereco_dm%d_eta%d_ener%d",i_area, i_eta, i_ener);
232 sprintf(
hname,
"hp_etrue_vs_ereco_dm%d_eta%d_ener%d",i_area, i_eta, i_ener);
242 for(
int i_pdg=0; i_pdg<
m_npdg; i_pdg++){
244 for(
int i_area=0; i_area<nArea; i_area++){
246 for(
int i_reco=0; i_reco<
m_nrecobin; i_reco++){
249 sprintf(
hname,
"m_hp_engRecoOverTruth_vs_eta_pdg%d_dm%d_reco%d_ener%d",i_pdg,i_area, i_reco, i_ener);
258 for(
int i_pdg=0; i_pdg<
m_npdg; i_pdg++){
260 for(
int i_area=0; i_area<nArea; i_area++){
262 for(
int i_reco=0; i_reco<
m_nrecobin; i_reco++){
266 for(
int i_eta=0; i_eta<
m_netabin; i_eta++){
267 sprintf(
hname,
"m_engRecSpect_pdg%d_dm%d_reco%d_ener%d_eta%d",i_pdg,i_area, i_reco, i_ener, i_eta);
279 std::cout <<
"CaloHadDMCoeffCheck::process() -> Info. Second loop to fill histogram " << std::endl;
281 if(i_ev%10000==0) std::cout <<
" i_ev: " << i_ev <<
" '" << ((TChain *)
m_data->
fChain)->GetFile()->GetName() <<
"'" << std::endl;
286 if(mc_etabin <0 || mc_etabin >=
m_netabin || mc_enerbin <0 || mc_enerbin >=
m_nlogenerbin || mc_phibin!=0)
continue;
296 std::vector<std::vector<double > > engDmReco;
298 std::vector<double > engDmRecSumClus;
299 std::vector<double > engDmTrueSumClus;
300 engDmRecSumClus.resize(nArea, 0.0);
301 engDmTrueSumClus.resize(nArea, 0.0);
302 double engClusSumCalib = 0.0;
303 double engClusSumOOC = 0.0;
304 double engClusSumDM = 0.0;
305 double engClusSumCalibInPresampler = 0.0;
312 engDmRecSumClus[i_area] += engDmReco[i_cls][i_area];
321 m_h2_etrue_vs_ereco[i_area][mc_etabin][mc_enerbin]->Fill(engDmTrueSumClus[i_area], engDmRecSumClus[i_area]);
322 m_hp_etrue_vs_ereco[i_area][mc_etabin][mc_enerbin]->Fill(engDmTrueSumClus[i_area], engDmRecSumClus[i_area]);
326 double sum = engClusSumCalib + engClusSumOOC + engClusSumDM - engClusSumCalibInPresampler;
328 for(
int i_reco=0; i_reco<
m_nrecobin; i_reco++){
329 double engReco = 0.0;
331 engReco =
sum - engDmTrueSumClus[i_area] + engDmRecSumClus[i_area];
335 engReco =
sum - engDmTrueSumClus[i_area];
337 std::cout <<
"panic" << std::endl;
349 TF1 *fun_p1 =
new TF1(
"fun_udeg3",
"[0]+[1]*x",1.,200000.);
350 for(
int i_area=0; i_area<nArea; i_area++){
351 for(
int i_eta=0; i_eta<
m_netabin; i_eta++){
354 if(hp->GetEntries() < 100)
continue;
355 float fitlim1 = hp->GetBinCenter(2);
356 float fitlim2 = hp->GetBinCenter(30);
357 hp->Fit(fun_p1,
"0Q",
"",fitlim1,fitlim2);
358 TF1 *
f=hp->GetFunction(fun_p1->GetName());
360 f->ResetBit(TF1::kNotDraw);