9 std::cout <<
"Initializing Histogram Manager..." << std::endl;
21 std::vector<std::string> theFolders;
22 std::vector<std::string>::iterator
fit;
25 std::map<std::string,std::pair<TH1*,string> >::const_iterator mapit;
26 for (mapit = theMap.begin(); mapit != theMap.end(); mapit++){
28 fit =
find(theFolders.begin(), theFolders.end(),
folder);
29 if (fit == theFolders.end()){
30 theFolders.push_back(folder);
31 theFile->mkdir(folder.c_str());
33 theFile->cd((*mapit).second.second.c_str());
34 (*mapit).second.first->Write();
43 theFile->cd(
"recHits");
47 theFile->cd(
"Segments");
58 rHTree =
new TTree(
"rHPositions",
"Local and Global reconstructed positions for recHits");
59 segTree =
new TTree(
"segPositions",
"Local and Global reconstructed positions for segments");
62 rHTree->Branch(
"rHpos",&rHpos,
"endcap/I:station/I:ring/I:chamber/I:layer/I:localx/F:localy/F:globalx/F:globaly/F");
63 segTree->Branch(
"segpos",&segpos,
"endcap/I:station/I:ring/I:chamber/I:layer/I:localx/F:localy/F:globalx/F:globaly/F");
102 theMap[
name] = std::pair<TH1*,string>(thePlot,
folder);
110 std::map<std::string,std::pair<TH1*,string> >::iterator it;
111 it = theMap.find(name);
112 if (it == theMap.end()){
113 theMap[
name] = std::pair<TH1*,string>(
new TH1I(name.c_str(),title.c_str(),
bins,
xmin,
xmax), folder);
116 theMap[
name].first->SetBinContent(bin,x);
124 std::map<std::string,std::pair<TH1*,string> >::iterator it;
125 it = theMap.find(name);
126 if (it == theMap.end()){
127 theMap[
name] = std::pair<TH1*,string>(
new TH1I(name.c_str(),title.c_str(),
bins,
xmin,
xmax), folder);
131 theMap[
name].first->Fill(x);
140 std::map<std::string,std::pair<TH1*,string> >::iterator it;
141 it = theMap.find(name);
142 if (it == theMap.end()){
146 theMap[
name].first->Fill(x,y);
155 if (
id.
endcap() == 1) endcap =
"+";
156 if (
id.
endcap() == 2) endcap =
"-";
158 std::map<std::string,std::pair<TH1*,string> >::iterator it;
161 oss1 << name << endcap <<
id.station() <<
id.ring();
162 oss2 << title <<
" (ME " << endcap <<
id.station() <<
"/" <<
id.ring() <<
")";
165 it = theMap.find(name);
166 if (it == theMap.end()){
167 theMap[
name] = std::pair<TH1*,string>(
new TH1F(name.c_str(),title.c_str(),
bins,
xmin,
xmax), folder);
170 theMap[
name].first->Fill(x);
179 if (
id.
endcap() == 1) endcap =
"+";
180 if (
id.
endcap() == 2) endcap =
"-";
182 std::map<std::string,std::pair<TH1*,string> >::iterator it;
185 oss1 << name << endcap <<
id.station() <<
id.ring();
186 oss2 << title <<
" (ME " << endcap <<
id.station() <<
"/" <<
id.ring() <<
")";
189 it = theMap.find(name);
190 if (it == theMap.end()){
194 theMap[
name].first->Fill(x,y);
202 int crate = crate_lookup(
id);
204 map<string,pair<TH1*,string> >::iterator it;
207 oss1 << name <<
"_crate_" << crate;
208 oss2 << title <<
" (crate " << crate <<
")";
211 it = theMap.find(name);
212 if (it == theMap.end()){
213 theMap[
name] = pair<TH1*,string>(
new TH1F(name.c_str(),title.c_str(),
bins,
xmin,
xmax), folder);
216 theMap[
name].first->Fill(x);
224 int crate = crate_lookup(
id);
226 map<string,pair<TH1*,string> >::iterator it;
229 oss1 << name <<
"_crate_" << crate;
230 oss2 << title <<
" (crate " << crate <<
")";
233 it = theMap.find(name);
234 if (it == theMap.end()){
238 theMap[
name].first->Fill(x,y);
248 if (
id.
endcap() == 1) endcap =
"+";
249 if (
id.
endcap() == 2) endcap =
"-";
251 map<string,pair<TH1*,string> >::iterator it;
254 oss1 << name << endcap <<
id.station();
255 oss2 << title <<
" (Station " << endcap <<
id.station() <<
")";
258 it = theMap.find(name);
259 if (it == theMap.end()){
260 theMap[
name] = pair<TH1*,string>(
new TH1F(name.c_str(),title.c_str(),
bins,
xmin,
xmax), folder);
263 theMap[
name].first->Fill(x);
273 if (
id.
endcap() == 1) endcap =
"+";
274 if (
id.
endcap() == 2) endcap =
"-";
276 std::map<std::string,std::pair<TH1*,string> >::iterator it;
279 oss1 << name << endcap <<
id.station();
280 oss2 << title <<
" (Station " << endcap <<
id.station() <<
")";
283 it = theMap.find(name);
284 if (it == theMap.end()){
288 theMap[
name].first->Fill(x,y);
297 if (
id.
endcap() == 1) endcap =
"+";
298 if (
id.
endcap() == 2) endcap =
"-";
300 std::map<std::string,std::pair<TH1*,string> >::iterator it;
303 oss1 << name <<
"_" << endcap <<
id.station() <<
"_" <<
id.ring() <<
"_" <<
id.chamber();
304 oss2 << title <<
" (ME " << endcap <<
id.station() <<
"/" <<
id.ring() <<
"/" <<
id.chamber() <<
")";
307 it = theMap.find(name);
308 if (it == theMap.end()){
309 theMap[
name] = std::pair<TH1*,string>(
new TH1F(name.c_str(),title.c_str(),
bins,
xmin,
xmax),folder);
312 theMap[
name].first->Fill(x);
322 if (
id.
endcap() == 1) endcap =
"+";
323 if (
id.
endcap() == 2) endcap =
"-";
325 std::map<std::string,std::pair<TH1*,string> >::iterator it;
328 oss1 << name <<
"_" << endcap <<
id.station() <<
"_" <<
id.ring() <<
"_" <<
id.chamber();
329 oss2 << title <<
" (ME " << endcap <<
id.station() <<
"/" <<
id.ring() <<
"/" <<
id.chamber() <<
")";
332 it = theMap.find(name);
333 if (it == theMap.end()){
337 theMap[
name].first->Fill(x,y);
344 if (
id.
endcap() == 1) endcap =
"+";
345 if (
id.
endcap() == 2) endcap =
"-";
347 map<string,pair<TH1*,string> >::iterator it;
350 oss1 << name <<
"_" << run <<
"_" <<
event ;
351 oss2 << title <<
" ( Run: " << run <<
" Event: " <<
event <<
" )";
354 it = theMap.find(name);
355 if (it == theMap.end()){
356 theMap[
name] = pair<TH1*,string>(
new TH2F(name.c_str(),title.c_str(),36,0.5,36.5,18,0.5,18.5),
folder);
359 int x =
id.chamber();
363 y = y + 3 + (
id.station()-2)*2;
370 dynamic_cast<TH2F*
>(theMap[
name].first)->
Fill(x,y,z);
376 map<string,pair<TH1*,string> >::iterator it;
377 it = theMap.find(
name);
378 if (it == theMap.end()){
379 theMap[
name] = pair<TH1*,string>(
new TH2F(
name.c_str(),
title.c_str(),36,0.5,36.5,18,0.5,18.5),
folder);
382 int x =
id.chamber();
386 y = y + 3 + (
id.station()-2)*2;
393 dynamic_cast<TH2F*
>(theMap[
name].first)->
Fill(x,y,z);
401 if (
id.
endcap() == 1) endcap =
"+";
402 if (
id.
endcap() == 2) endcap =
"-";
404 std::map<std::string,std::pair<TH1*,string> >::iterator it;
407 oss1 << name <<
"_" << endcap <<
id.station() <<
"_" <<
id.ring() <<
"_" <<
id.chamber() <<
"_L" <<
id.layer();
408 oss2 << title <<
" (ME " << endcap <<
id.station() <<
"/" <<
id.ring() <<
"/" <<
id.chamber() <<
"/L" <<
id.layer() <<
")";
411 it = theMap.find(name);
412 if (it == theMap.end()){
413 theMap[
name] = std::pair<TH1*,string>(
new TH1F(name.c_str(),title.c_str(),
bins,
xmin,
xmax),folder);
416 theMap[
name].first->Fill(x);
426 if (
id.
endcap() == 1) endcap =
"+";
427 if (
id.
endcap() == 2) endcap =
"-";
429 std::map<std::string,std::pair<TH1*,string> >::iterator it;
432 oss1 << name <<
"_" << endcap <<
id.station() <<
"_" <<
id.ring() <<
"_" <<
id.chamber() <<
"_L" <<
id.layer();;
433 oss2 << title <<
" (ME " << endcap <<
id.station() <<
"/" <<
id.ring() <<
"/" <<
id.chamber() <<
"/L" <<
id.layer() <<
")";
436 it = theMap.find(name);
437 if (it == theMap.end()){
441 theMap[
name].first->Fill(x,y);
450 std::map<std::string,std::pair<TH1*,string> >::iterator it;
451 it = theMap.find(name);
452 if (it == theMap.end()){
456 theMap[
name].first->Fill(x,y);
465 std::map<std::string,std::pair<TH1*,string> >::iterator it;
467 if (
id.
endcap() == 1) endcap =
"+";
468 if (
id.
endcap() == 2) endcap =
"-";
472 oss1 << name << endcap <<
id.station() <<
id.ring();
473 oss2 << title <<
" (ME " << endcap <<
id.station() <<
"/" <<
id.ring() <<
")";
477 it = theMap.find(name);
478 if (it == theMap.end()){
482 theMap[
name].first->Fill(x,y);
491 std::map<std::string,std::pair<TH1*,string> >::iterator it;
493 if (
id.
endcap() == 1) endcap =
"+";
494 if (
id.
endcap() == 2) endcap =
"-";
498 oss1 << name <<
"_" << endcap <<
id.station() <<
"_" <<
id.ring() <<
"_" <<
id.chamber();
499 oss2 << title <<
" (ME " << endcap <<
id.station() <<
"/" <<
id.ring() <<
"/" <<
id.chamber() <<
")";
503 it = theMap.find(name);
504 if (it == theMap.end()){
508 theMap[
name].first->Fill(x,y);
518 std::map<std::string,std::pair<TH1*,string> >::iterator it;
520 it = theMap.find(name);
521 if (it == theMap.end()){
522 theMap[
name] = std::pair<TProfile2D*,string>(
new TProfile2D(name.c_str(),title.c_str(),
binsx,
xmin,
xmax,
binsy,
ymin,
ymax,zmin,zmax), folder);
525 TProfile2D *tempp = (TProfile2D*)theMap[name].
first;
549 crate = 12 +
id.triggerSector() + (
id.station()-2)*6;
int crate_lookup(CSCDetId id)
void fill2DHistByStation(float x, float y, std::string name, std::string title, CSCDetId id, int binsx, float xmin, float xmax, int binsy, float ymin, float ymax, std::string folder)
void fillProfileByType(float x, float y, std::string name, std::string title, CSCDetId id, int binsx, float xmin, float xmax, float ymin, float ymax, std::string folder)
void fillProfile(float x, float y, std::string name, std::string title, int binsx, float xmin, float xmax, float ymin, float ymax, std::string folder)
void writeTrees(TFile *theFile)
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
void fill1DHist(float x, std::string name, std::string title, int bins, float xmin, float xmax, std::string folder)
void fill2DHistByCrate(float x, float y, std::string name, std::string title, CSCDetId id, int binsx, float xmin, float xmax, int binsy, float ymin, float ymax, std::string folder)
void fill1DHistByLayer(float x, std::string name, std::string title, CSCDetId id, int bins, float xmin, float xmax, std::string folder)
void fillProfileByChamber(float x, float y, std::string name, std::string title, CSCDetId id, int binsx, float xmin, float xmax, float ymin, float ymax, std::string folder)
T x() const
Cartesian x coordinate.
void writeHists(TFile *theFile)
void insertPlot(TH1 *thePlot, std::string name, std::string folder)
void Fill(HcalDetId &id, double val, std::vector< TH2F > &depth)
void fill1DHistByType(float x, std::string name, std::string title, CSCDetId id, int bins, float xmin, float xmax, std::string folder)
void fillRechitTree(float x, float y, float gx, float gy, int en, int st, int ri, int ch, int la)
How EventSelector::AcceptEvent() decides whether to accept an event for output otherwise it is excluding the probing of A single or multiple positive and the trigger will pass if any such matching triggers are PASS or EXCEPTION[A criterion thatmatches no triggers at all is detected and causes a throw.] A single negative with an expectation of appropriate bit checking in the decision and the trigger will pass if any such matching triggers are FAIL or EXCEPTION A wildcarded negative criterion that matches more than one trigger in the trigger but the state exists so we define the behavior If all triggers are the negative crieriion will lead to accepting the event(this again matches the behavior of"!*"before the partial wildcard feature was incorporated).The per-event"cost"of each negative criterion with multiple relevant triggers is about the same as!*was in the past
void fill1DHistByCrate(float x, std::string name, std::string title, CSCDetId id, int bins, float xmin, float xmax, std::string folder)
void fill2DHistByLayer(float x, float y, std::string name, std::string title, CSCDetId id, int binsx, float xmin, float xmax, int binsy, float ymin, float ymax, std::string folder)
bin
set the eta bin as selection string.
void fill1DHistByStation(float x, std::string name, std::string title, CSCDetId id, int bins, float xmin, float xmax, std::string folder)
void fill1DHistByChamber(float x, std::string name, std::string title, CSCDetId id, int bins, float xmin, float xmax, std::string folder)
void fill2DHistByChamber(float x, float y, std::string name, std::string title, CSCDetId id, int binsx, float xmin, float xmax, int binsy, float ymin, float ymax, std::string folder)
void fill2DHistByEvent(int run, int event, float x, std::string name, std::string title, CSCDetId id, std::string folder)
void fill2DHist(float x, float y, std::string name, std::string title, int binsx, float xmin, float xmax, int binsy, float ymin, float ymax, std::string folder)
void fill2DHistByType(float x, float y, std::string name, std::string title, CSCDetId id, int binsx, float xmin, float xmax, int binsy, float ymin, float ymax, std::string folder)
void fillSegmentTree(float x, float y, float gx, float gy, int en, int st, int ri, int ch)
void fill2DProfile(float x, float y, float z, std::string name, std::string title, int binsx, float xmin, float xmax, int binsy, float ymin, float ymax, float zmin, float zmax, std::string folder)
void fillCalibHist(float x, std::string name, std::string title, int bins, float xmin, float xmax, int bin, std::string folder)