Skip to content

Commit

Permalink
Update the macros
Browse files Browse the repository at this point in the history
  • Loading branch information
Sunanda committed Nov 19, 2017
1 parent 3ed91f1 commit b7fda30
Show file tree
Hide file tree
Showing 2 changed files with 100 additions and 34 deletions.
78 changes: 54 additions & 24 deletions Calibration/HcalCalibAlgos/macros/AnalyzeLepTree.C
Expand Up @@ -114,6 +114,7 @@ private:
Int_t t_nvtx;
Double_t t_p;
std::vector<double> *t_ene;
std::vector<double> *t_enec;
std::vector<double> *t_charge;
std::vector<double> *t_actln;
std::vector<int> *t_depth;
Expand All @@ -124,6 +125,7 @@ private:
TBranch *b_t_nvtx; //!
TBranch *b_t_p; //!
TBranch *b_t_ene; //!
TBranch *b_t_enec; //!
TBranch *b_t_charge; //!
TBranch *b_t_actln; //!
TBranch *b_t_depth; //!
Expand All @@ -135,6 +137,7 @@ private:
std::map<unsigned int, TH2D*> h_pnv_;
std::map<unsigned int, TH1D*> h_p2_, h_nv2_;
std::map<unsigned int, TH1D*> h_Energy_, h_Ecorr_, h_Charge_, h_Chcorr_;
std::map<unsigned int, TH1D*> h_EnergyC_, h_EcorrC_;
};

AnalyzeLepTree::AnalyzeLepTree(TTree *tree, int mode1,
Expand Down Expand Up @@ -185,6 +188,7 @@ void AnalyzeLepTree::Init(TTree *tree) {

// Set object pointer
t_ene = 0;
t_enec = 0;
t_charge = 0;
t_actln = 0;
t_depth = 0;
Expand All @@ -199,6 +203,7 @@ void AnalyzeLepTree::Init(TTree *tree) {
fChain->SetBranchAddress("t_nvtx", &t_nvtx, &b_t_nvtx);
fChain->SetBranchAddress("t_p", &t_p, &b_t_p);
fChain->SetBranchAddress("t_ene", &t_ene, &b_t_ene);
fChain->SetBranchAddress("t_enec", &t_enec, &b_t_enec);
fChain->SetBranchAddress("t_charge", &t_charge, &b_t_charge);
fChain->SetBranchAddress("t_actln", &t_actln, &b_t_actln);
fChain->SetBranchAddress("t_depth", &t_depth, &b_t_depth);
Expand Down Expand Up @@ -289,41 +294,51 @@ void AnalyzeLepTree::Loop() {
int depth = (*t_depth)[k];
unsigned int id = packID(zside,eta,phi,depth+1,vbin,pbin);
double ene = (*t_ene)[k];
double enec = (*t_enec)[k];
double charge = (*t_charge)[k];
double actl = (*t_actln)[k];
if (ene > 0 && actl > 0 && charge > 0) {
std::map<unsigned int,TH1D*>::iterator it1 = h_Energy_.find(id);
if (it1 != h_Energy_.end()) (it1->second)->Fill(ene);
if (it1 != h_Energy_.end()) (it1->second)->Fill(ene);
std::map<unsigned int,TH1D*>::iterator it2 = h_Ecorr_.find(id);
if (it2 != h_Ecorr_.end()) (it2->second)->Fill(ene/actl);
std::map<unsigned int,TH1D*>::iterator it3 = h_Charge_.find(id);
if (it3 != h_Charge_.end()) (it3->second)->Fill(charge);
std::map<unsigned int,TH1D*>::iterator it4 = h_Chcorr_.find(id);
if (it4 != h_Chcorr_.end()) (it4->second)->Fill(charge/actl);
if (it2 != h_Ecorr_.end()) (it2->second)->Fill(ene/actl);
std::map<unsigned int,TH1D*>::iterator it3 = h_EnergyC_.find(id);
if (it3 != h_EnergyC_.end()) (it3->second)->Fill(enec);
std::map<unsigned int,TH1D*>::iterator it4 = h_EcorrC_.find(id);
if (it4 != h_EcorrC_.end()) (it4->second)->Fill(enec/actl);
std::map<unsigned int,TH1D*>::iterator it5 = h_Charge_.find(id);
if (it5 != h_Charge_.end()) (it5->second)->Fill(charge);
std::map<unsigned int,TH1D*>::iterator it6 = h_Chcorr_.find(id);
if (it6 != h_Chcorr_.end()) (it6->second)->Fill(charge/actl);
/*
if ((eta>20 && (t_iphi > 35)) || (t_iphi > 71)) std::cout << zside << ":" << eta << ":" << phi << ":" << t_iphi << ":" << depth+1 << ":" << vbin << ":" << pbin << " ID " << std::hex << id << std::dec << " Flags " << (it1 != h_Energy_.end()) << ":" << (it2 != h_Ecorr_.end()) << ":" << (it3 != h_Charge_.end()) << ":" << (it4 != h_Chcorr_.end()) << " E " << ene << " C " << charge << " L " << actl << std::endl;
if ((it1 == h_Energy_.end()) || (it2 == h_Ecorr_.end()) || (it3 == h_Charge_.end()) || (it4 == h_Chcorr_.end())) std::cout << zside << ":" << eta << ":" << phi << ":" << t_iphi << ":" << depth+1 << ":" << vbin << ":" << pbin << " ID " << std::hex << id << std::dec << " Flags " << (it1 != h_Energy_.end()) << ":" << (it2 != h_Ecorr_.end()) << ":" << (it3 != h_Charge_.end()) << ":" << (it4 != h_Chcorr_.end()) << " E " << ene << " C " << charge << " L " << actl << std::endl;
if ((eta>20 && (t_iphi > 35)) || (t_iphi > 71)) std::cout << zside << ":" << eta << ":" << phi << ":" << t_iphi << ":" << depth+1 << ":" << vbin << ":" << pbin << " ID " << std::hex << id << std::dec << " Flags " << (it1 != h_Energy_.end()) << ":" << (it2 != h_Ecorr_.end()) << ":" << (it3 != h_EnergyC_.end()) << ":" << (it4 != h_EcorrC_.end()) << ":" << (it5 != h_Charge_.end()) << ":" << (it6 != h_Chcorr_.end()) << " E " << ene << " C " << charge << " L " << actl << std::endl;
if ((it1 == h_Energy_.end()) || (it2 == h_Ecorr_.end()) || (it3 == h_EnergyC_.end()) || (it4 == h_EcorrC_.end()) || (it5 == h_Charge_.end()) || (it6 == h_Chcorr_.end())) std::cout << zside << ":" << eta << ":" << phi << ":" << t_iphi << ":" << depth+1 << ":" << vbin << ":" << pbin << " ID " << std::hex << id << std::dec << " Flags " << (it1 != h_Energy_.end()) << ":" << (it2 != h_Ecorr_.end()) << ":" << (it3 != h_Charge_.end()) << ":" << (it4 != h_Chcorr_.end()) << " E " << ene << " C " << charge << " L " << actl << std::endl;
*/
}
}
} else {
double ene(0), actl(0), charge(0);
double ene(0), enec(0), actl(0), charge(0);
unsigned int id = packID(zside,eta,phi,1,vbin,pbin);
for (unsigned int k=0; k<t_depth->size(); ++k) {
if ((*t_ene)[k] > 0 && (*t_actln)[k] > 0 && (*t_charge)[k] > 0) {
if ((*t_ene)[k] > 0 && (*t_actln)[k] > 0) {
ene += (*t_ene)[k];
enec += (*t_enec)[k];
charge += (*t_charge)[k];
actl += (*t_actln)[k];
}
}
std::map<unsigned int,TH1D*>::iterator it1 = h_Energy_.find(id);
if (it1 != h_Energy_.end()) (it1->second)->Fill(ene);
if (it1 != h_Energy_.end()) (it1->second)->Fill(ene);
std::map<unsigned int,TH1D*>::iterator it2 = h_Ecorr_.find(id);
if (it2 != h_Ecorr_.end()) (it2->second)->Fill(ene/actl);
std::map<unsigned int,TH1D*>::iterator it3 = h_Charge_.find(id);
if (it3 != h_Charge_.end()) (it3->second)->Fill(charge);
std::map<unsigned int,TH1D*>::iterator it4 = h_Chcorr_.find(id);
if (it4 != h_Chcorr_.end()) (it4->second)->Fill(charge/actl);
if (it2 != h_Ecorr_.end()) (it2->second)->Fill(ene/actl);
std::map<unsigned int,TH1D*>::iterator it3 = h_EnergyC_.find(id);
if (it3 != h_EnergyC_.end()) (it3->second)->Fill(ene);
std::map<unsigned int,TH1D*>::iterator it4 = h_Ecorr_.find(id);
if (it4 != h_EcorrC_.end()) (it4->second)->Fill(ene/actl);
std::map<unsigned int,TH1D*>::iterator it5 = h_Charge_.find(id);
if (it5 != h_Charge_.end()) (it5->second)->Fill(charge);
std::map<unsigned int,TH1D*>::iterator it6 = h_Chcorr_.find(id);
if (it6 != h_Chcorr_.end()) (it6->second)->Fill(charge/actl);
}
}
}
Expand Down Expand Up @@ -400,6 +415,7 @@ void AnalyzeLepTree::bookHisto() {
}
} else {
h_Energy_.clear(); h_Ecorr_.clear(); h_Charge_.clear(); h_Chcorr_.clear();
h_EnergyC_.clear(); h_EcorrC_.clear();
for (int ieta=-26; ieta<=26; ++ieta) {
if (ieta != 0) {
int zside = (ieta>0) ? 1 : -1;
Expand Down Expand Up @@ -449,6 +465,14 @@ void AnalyzeLepTree::bookHisto() {
sprintf (title,"Active length corrected energy for %s %s %s %s %s (GeV/cm)", etas, phis, deps, ps, vtx);
h_Ecorr_[id] = new TH1D(name,title,4000,0.0,10.0);
h_Ecorr_[id]->Sumw2();
sprintf (name,"EdepCE%dF%dD%dV%dP%d",ieta,phi,depth,vbin,pbin);
sprintf (title,"Response Corrected deposited energy for %s %s %s %s %s (GeV)", etas, phis, deps, ps, vtx);
h_EnergyC_[id] = new TH1D(name,title,4000,0.0,10.0);
h_EnergyC_[id]->Sumw2();
sprintf (name,"EcorCE%dF%dD%dV%dP%d",ieta,phi,depth,vbin,pbin);
sprintf (title,"Response and active length corrected energy for %s %s %s %s %s (GeV/cm)", etas, phis, deps, ps, vtx);
h_EcorrC_[id] = new TH1D(name,title,4000,0.0,10.0);
h_EcorrC_[id]->Sumw2();
sprintf (name,"ChrgE%dF%dD%dV%dP%d",ieta,phi,depth,vbin,pbin);
sprintf (title,"Measured charge for %s %s %s %s %s (cm)", etas, phis, deps, ps, vtx);
h_Charge_[id] = new TH1D(name,title,20,0.0,20.0);
Expand Down Expand Up @@ -505,13 +529,17 @@ void AnalyzeLepTree::writeHisto(std::string fname) {
unsigned int id = packID(zside,eta,phi,depth+1,vbin,pbin);
std::map<unsigned int,TH1D*>::const_iterator itr;
itr = h_Energy_.find(id);
if (itr != h_Energy_.end()) (itr->second)->Write();
if (itr != h_Energy_.end()) (itr->second)->Write();
itr = h_Ecorr_.find(id);
if (itr != h_Ecorr_.end()) (itr->second)->Write();
if (itr != h_Ecorr_.end()) (itr->second)->Write();
itr = h_EnergyC_.find(id);
if (itr != h_EnergyC_.end()) (itr->second)->Write();
itr = h_EcorrC_.find(id);
if (itr != h_EcorrC_.end()) (itr->second)->Write();
itr = h_Charge_.find(id);
if (itr != h_Charge_.end()) (itr->second)->Write();
if (itr != h_Charge_.end()) (itr->second)->Write();
itr = h_Chcorr_.find(id);
if (itr != h_Chcorr_.end()) (itr->second)->Write();
if (itr != h_Chcorr_.end()) (itr->second)->Write();
}
}
}
Expand Down Expand Up @@ -548,10 +576,12 @@ std::vector<TCanvas*> AnalyzeLepTree::plotHisto(bool drawStatBox, int type,
bool doEnL = ((type/2)%2 > 0);
bool doChg = ((type/4)%2 > 0);
bool doChL = ((type/8)%2 > 0);
if (doEn) plotHisto(h_Energy_, phi0, depth0, cvs, save);
if (doEnL) plotHisto(h_Ecorr_, phi0, depth0, cvs, save);
if (doChg) plotHisto(h_Charge_, phi0, depth0, cvs, save);
if (doChL) plotHisto(h_Chcorr_, phi0, depth0, cvs, save);
if (doEn) plotHisto(h_Energy_, phi0, depth0, cvs, save);
if (doEn) plotHisto(h_EnergyC_, phi0, depth0, cvs, save);
if (doEnL) plotHisto(h_Ecorr_, phi0, depth0, cvs, save);
if (doEnL) plotHisto(h_EcorrC_, phi0, depth0, cvs, save);
if (doChg) plotHisto(h_Charge_, phi0, depth0, cvs, save);
if (doChL) plotHisto(h_Chcorr_, phi0, depth0, cvs, save);
}
return cvs;
}
Expand Down
56 changes: 46 additions & 10 deletions Calibration/HcalCalibAlgos/macros/HBHEMuonOfflineAnalyzer.C
Expand Up @@ -362,7 +362,7 @@ private:
TTree *outtree_;
int t_ieta, t_iphi, t_nvtx;
double t_p;
std::vector<double> t_ene, t_actln, t_charge;
std::vector<double> t_ene, t_enec, t_actln, t_charge;
std::vector<int> t_depth;

TH1D *h_Pt_Muon[3], *h_Eta_Muon[3], *h_Phi_Muon[3], *h_P_Muon[3];
Expand Down Expand Up @@ -760,7 +760,8 @@ void HBHEMuonOfflineAnalyzer::Loop() {
if (debug_) std::cout << "Run " << Run_No << " Event " << Event_No << " Muons " << pt_of_muon->size() << std::endl;
for (unsigned int ml = 0; ml< pt_of_muon->size(); ml++) {

t_ene.clear(); t_charge.clear(); t_actln.clear(); t_depth.clear();
t_ene.clear(); t_enec.clear(); t_charge.clear(); t_actln.clear();
t_depth.clear();

if(debug_) std::cout << "ecal_det_id " << ecal_detID->at(ml) << std::endl;

Expand Down Expand Up @@ -848,31 +849,40 @@ void HBHEMuonOfflineAnalyzer::Loop() {
h_HotCell[cut]->Fill(hcal_cellHot->at(ml));
if (mergeDepth_) {
double en1(0), en2(0), energyFill(0), chargeS(0), chargeBG(0);
double enh(0), enc(0);
for (int dep=0; dep<nDepth; ++dep) {
if (dep == 0) {
en1 += ((useCorrect_) ? hcal_edepthCorrect1->at(ml) : hcal_edepth1->at(ml));
en2 += ((useCorrect_) ? hcal_edepthHotCorrect1->at(ml) : hcal_edepthHot1->at(ml));
enh += (hcal_edepthHot1->at(ml));
enc += (hcal_edepthHotCorrect1->at(ml));
energyFill += (hcal_activeHotL1->at(ml));
chargeS += (hcal_cdepthHot1->at(ml));
chargeBG += (hcal_cdepthHotBG1->at(ml));

} else if (dep == 1) {
en1 += ((useCorrect_) ? hcal_edepthCorrect2->at(ml) : hcal_edepth2->at(ml));
en2 += ((useCorrect_) ? hcal_edepthHotCorrect2->at(ml) : hcal_edepthHot2->at(ml));
enh += (hcal_edepthHot2->at(ml));
enc += (hcal_edepthHotCorrect2->at(ml));
energyFill += (hcal_activeHotL2->at(ml));
chargeS += (hcal_cdepthHot2->at(ml));
chargeBG += (hcal_cdepthHotBG2->at(ml));

} else if (dep == 2) {
en1 += ((useCorrect_) ? hcal_edepthCorrect3->at(ml) : hcal_edepth3->at(ml));
en2 += ((useCorrect_) ? hcal_edepthHotCorrect3->at(ml) : hcal_edepthHot3->at(ml));
enh += (hcal_edepthHot3->at(ml));
enc += (hcal_edepthHotCorrect3->at(ml));
energyFill += (hcal_activeHotL3->at(ml));
chargeS += (hcal_cdepthHot3->at(ml));
chargeBG += (hcal_cdepthHotBG3->at(ml));

} else if (dep == 3) {
en1 += ((useCorrect_) ? hcal_edepthCorrect4->at(ml) : hcal_edepth4->at(ml));
en2 += ((useCorrect_) ? hcal_edepthHotCorrect4->at(ml) : hcal_edepthHot4->at(ml));
enh += (hcal_edepthHot4->at(ml));
enc += (hcal_edepthHotCorrect4->at(ml));
energyFill = hcal_activeHotL4->at(ml);
chargeS += (hcal_cdepthHot4->at(ml));
chargeBG += (hcal_cdepthHotBG4->at(ml));
Expand All @@ -881,6 +891,8 @@ void HBHEMuonOfflineAnalyzer::Loop() {
if (hcal_edepthCorrect5->size() > ml) {
en1 += ((useCorrect_) ? hcal_edepthCorrect5->at(ml) : hcal_edepth5->at(ml));
en2 += ((useCorrect_) ? hcal_edepthHotCorrect5->at(ml) : hcal_edepthHot5->at(ml));
enh += (hcal_edepthHot5->at(ml));
enc += (hcal_edepthHotCorrect5->at(ml));
energyFill += (hcal_activeHotL5->at(ml));
chargeS += (hcal_cdepthHot5->at(ml));
chargeBG += (hcal_cdepthHotBG5->at(ml));
Expand All @@ -890,6 +902,8 @@ void HBHEMuonOfflineAnalyzer::Loop() {
if (hcal_edepthCorrect6->size() > ml) {
en1 += ((useCorrect_) ? hcal_edepthCorrect6->at(ml) : hcal_edepth6->at(ml));
en2 += ((useCorrect_) ? hcal_edepthHotCorrect6->at(ml) : hcal_edepthHot6->at(ml));
enh += (hcal_edepthHot6->at(ml));
enc += (hcal_edepthHotCorrect6->at(ml));
energyFill += (hcal_activeHotL6->at(ml));
chargeS += (hcal_cdepthHot6->at(ml));
chargeBG += (hcal_cdepthHotBG6->at(ml));
Expand All @@ -899,6 +913,8 @@ void HBHEMuonOfflineAnalyzer::Loop() {
if (hcal_edepthCorrect7->size() > ml) {
en1 += ((useCorrect_) ? hcal_edepthCorrect7->at(ml) : hcal_edepth7->at(ml));
en2 += ((useCorrect_) ? hcal_edepthHotCorrect7->at(ml) : hcal_edepthHot7->at(ml));
enh += (hcal_edepthHot7->at(ml));
enc += (hcal_edepthHotCorrect7->at(ml));
energyFill += (hcal_activeHotL7->at(ml));
chargeS += (hcal_cdepthHot7->at(ml));
chargeBG += (hcal_cdepthHotBG7->at(ml));
Expand All @@ -911,9 +927,9 @@ void HBHEMuonOfflineAnalyzer::Loop() {
std::cout << "Matched Id " << matchedId->at(ml) << " Hot "
<< hcal_cellHot->at(ml) << " eta " << etaHcal << ":"
<< eta << " phi " << phiHcal << ":" << PHI
<< " Index " << ind << " E " << en2 << ":"
<< energyFill << " Charge " << chargeS << ":"
<< chargeBG << std::endl;
<< " Index " << ind << " E " << en1 << ":" << en2
<< ":" << enh << ":" << enc << " L " << energyFill
<< " Charge " << chargeS << ":" << chargeBG <<std::endl;
if (!(matchedId->at(ml))) continue;
if (hcal_cellHot->at(ml)==1) {
if (energyFill > 0) {
Expand All @@ -924,7 +940,8 @@ void HBHEMuonOfflineAnalyzer::Loop() {
h_charge_signal[cut][ind]->Fill(chargeS);
h_charge_bg[cut][ind]->Fill(chargeBG);

t_ene.push_back(en2);
t_ene.push_back(enh);
t_enec.push_back(enc);
t_charge.push_back(chargeS);
t_actln.push_back(energyFill);
t_depth.push_back(0);
Expand All @@ -938,35 +955,46 @@ void HBHEMuonOfflineAnalyzer::Loop() {

if(debug_) std::cout<<"dep:"<<dep<<std::endl;

double en1(-9999), en2(-9999), energyFill(0), chargeS(-9999), chargeBG(-9999);
double en1(-9999), en2(-9999), energyFill(0), chargeS(-9999);
double enh(-9999), enc(-9999), chargeBG(-9999);
if (dep == 0) {
en1 = (useCorrect_) ? hcal_edepthCorrect1->at(ml) : hcal_edepth1->at(ml);
en2 = (useCorrect_) ? hcal_edepthHotCorrect1->at(ml) : hcal_edepthHot1->at(ml);
enh = (hcal_edepthHot1->at(ml));
enc = (hcal_edepthHotCorrect1->at(ml));
energyFill = hcal_activeHotL1->at(ml);
chargeS = (hcal_cdepthHot1->at(ml));
chargeBG = (hcal_cdepthHotBG1->at(ml));
} else if (dep == 1) {
en1 = (useCorrect_) ? hcal_edepthCorrect2->at(ml) : hcal_edepth2->at(ml);
en2 = (useCorrect_) ? hcal_edepthHotCorrect2->at(ml) : hcal_edepthHot2->at(ml);
enh = (hcal_edepthHot2->at(ml));
enc = (hcal_edepthHotCorrect2->at(ml));
energyFill = hcal_activeHotL2->at(ml);
chargeS = (hcal_cdepthHot2->at(ml));
chargeBG = (hcal_cdepthHotBG2->at(ml));
} else if (dep == 2) {
en1 = (useCorrect_) ? hcal_edepthCorrect3->at(ml) : hcal_edepth3->at(ml);
en2 = (useCorrect_) ? hcal_edepthHotCorrect3->at(ml) : hcal_edepthHot3->at(ml);
enh = (hcal_edepthHot3->at(ml));
enc = (hcal_edepthHotCorrect3->at(ml));
energyFill = hcal_activeHotL3->at(ml);
chargeS = (hcal_cdepthHot3->at(ml));
chargeBG = (hcal_cdepthHotBG3->at(ml));
} else if (dep == 3) {
en1 = (useCorrect_) ? hcal_edepthCorrect4->at(ml) : hcal_edepth4->at(ml);
en2 = (useCorrect_) ? hcal_edepthHotCorrect4->at(ml) : hcal_edepthHot4->at(ml);
enh = (hcal_edepthHot4->at(ml));
enc = (hcal_edepthHotCorrect4->at(ml));
energyFill = hcal_activeHotL4->at(ml);
chargeS = (hcal_cdepthHot4->at(ml));
chargeBG = (hcal_cdepthHotBG4->at(ml));
} else if (dep == 4) {
if (hcal_edepthCorrect5->size() > ml) {
en1 = (useCorrect_) ? hcal_edepthCorrect5->at(ml) : hcal_edepth5->at(ml);
en2 = (useCorrect_) ? hcal_edepthHotCorrect5->at(ml) : hcal_edepthHot5->at(ml);
enh = (hcal_edepthHot5->at(ml));
enc = (hcal_edepthHotCorrect5->at(ml));
energyFill = hcal_activeHotL5->at(ml);
chargeS = (hcal_cdepthHot5->at(ml));
chargeBG = (hcal_cdepthHotBG5->at(ml));
Expand All @@ -975,6 +1003,8 @@ void HBHEMuonOfflineAnalyzer::Loop() {
if (hcal_edepthCorrect6->size() > ml) {
en1 = (useCorrect_) ? hcal_edepthCorrect6->at(ml) : hcal_edepth6->at(ml);
en2 = (useCorrect_) ? hcal_edepthHotCorrect6->at(ml) : hcal_edepthHot6->at(ml);
enh = (hcal_edepthHot6->at(ml));
enc = (hcal_edepthHotCorrect6->at(ml));
energyFill = hcal_activeHotL6->at(ml);
chargeS = (hcal_cdepthHot6->at(ml));
chargeBG = (hcal_cdepthHotBG6->at(ml));
Expand All @@ -983,6 +1013,8 @@ void HBHEMuonOfflineAnalyzer::Loop() {
if (hcal_edepthCorrect7->size() > ml) {
en1 = (useCorrect_) ? hcal_edepthCorrect7->at(ml) : hcal_edepth7->at(ml);
en2 = (useCorrect_) ? hcal_edepthHotCorrect7->at(ml) : hcal_edepthHot7->at(ml);
enh = (hcal_edepthHot7->at(ml));
enc = (hcal_edepthHotCorrect7->at(ml));
energyFill = hcal_activeHotL7->at(ml);
chargeS = (hcal_cdepthHot7->at(ml));
chargeBG = (hcal_cdepthHotBG7->at(ml));
Expand All @@ -1004,8 +1036,9 @@ void HBHEMuonOfflineAnalyzer::Loop() {
<< hcal_cellHot->at(ml) << " eta " << etaHcal << ":"
<< eta << " phi " << phiHcal << ":" << PHI
<< " depth " << dep << " Index " << ind << " E "
<< en2 << ":" << energyFill << " Charge "
<< chargeS << ":" << chargeBG << std::endl;
<< en1 << ":" << en2 << ":" << enh << ":" << enc
<< " L " << energyFill << " Charge " << chargeS
<< ":" << chargeBG << std::endl;
if (!(matchedId->at(ml))) continue;
if (ok1) {
if (debug_) std::cout<<"enter ok1"<<std::endl;
Expand All @@ -1018,14 +1051,16 @@ void HBHEMuonOfflineAnalyzer::Loop() {
h_p_muon_ineta[cut][ind]->Fill(p_of_muon->at(ml));
h_charge_signal[cut][ind]->Fill(chargeS);
h_charge_bg[cut][ind]->Fill(chargeBG);
t_ene.push_back(en2);
t_ene.push_back(enh);
t_enec.push_back(enc);
t_charge.push_back(chargeS);
t_actln.push_back(energyFill);
// added depth vector AmanKalsi
t_depth.push_back(dep);
fillTree = true;
} else {
t_ene.push_back(-999.0);
t_enec.push_back(-999.0);
t_charge.push_back(-999.0);
t_actln.push_back(-999.0);
t_depth.push_back(-999.0);
Expand Down Expand Up @@ -1079,6 +1114,7 @@ void HBHEMuonOfflineAnalyzer::BookHistograms(const char* fname) {
outtree_->Branch("t_nvtx", &t_nvtx);
outtree_->Branch("t_p", &t_p);
outtree_->Branch("t_ene", &t_ene);
outtree_->Branch("t_enec", &t_enec);
outtree_->Branch("t_charge", &t_charge);
outtree_->Branch("t_actln", &t_actln);
outtree_->Branch("t_depth", &t_depth);
Expand Down

0 comments on commit b7fda30

Please sign in to comment.