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++){
27 std::string folder = (*mapit).second.second.c_str();
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);
108 int bin, std::string 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);
122 int bins,
float xmin,
float xmax, std::string folder){
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);
137 int binsx,
float xmin,
float xmax,
138 int binsy,
float ymin,
float ymax, std::string folder){
140 std::map<std::string,std::pair<TH1*,string> >::iterator it;
141 it = theMap.find(name);
142 if (it == theMap.end()){
143 theMap[
name] = std::pair<TH1*,string>(
new TH2F(name.c_str(),title.c_str(),binsx,xmin,xmax,binsy,ymin,ymax),folder);
146 theMap[
name].first->Fill(x,y);
152 int bins,
float xmin,
float xmax, std::string folder){
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);
175 int binsx,
float xmin,
float xmax,
176 int binsy,
float ymin,
float ymax, std::string folder){
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()){
191 theMap[
name] = std::pair<TH1*,string>(
new TH2F(name.c_str(),title.c_str(),binsx,xmin,xmax,binsy,ymin,ymax), folder);
194 theMap[
name].first->Fill(x,y);
200 int bins,
float xmin,
float xmax,
string folder){
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);
221 int binsx,
float xmin,
float xmax,
222 int binsy,
float ymin,
float ymax,
string folder){
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()){
235 theMap[
name] = pair<TH1*,string>(
new TH2F(name.c_str(),title.c_str(),binsx,xmin,xmax,binsy,ymin,ymax), folder);
238 theMap[
name].first->Fill(x,y);
245 int bins,
float xmin,
float xmax,
string folder){
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);
269 int binsx,
float xmin,
float xmax,
270 int binsy,
float ymin,
float ymax, std::string folder){
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()){
285 theMap[
name] = std::pair<TH1*,string>(
new TH2F(name.c_str(),title.c_str(),binsx,xmin,xmax,binsy,ymin,ymax), folder);
288 theMap[
name].first->Fill(x,y);
294 int bins,
float xmin,
float xmax, std::string folder){
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);
318 int binsx,
float xmin,
float xmax,
319 int binsy,
float ymin,
float ymax, std::string folder){
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()){
334 theMap[
name] = std::pair<TH1*,string>(
new TH2F(name.c_str(),title.c_str(),binsx,xmin,xmax,binsy,ymin,ymax),folder);
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);
398 int bins,
float xmin,
float xmax,
string folder){
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);
422 int binsx,
float xmin,
float xmax,
423 int binsy,
float ymin,
float ymax, std::string folder){
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()){
438 theMap[
name] = std::pair<TH1*,string>(
new TH2F(name.c_str(),title.c_str(),binsx,xmin,xmax,binsy,ymin,ymax),folder);
441 theMap[
name].first->Fill(x,y);
447 int binsx,
float xmin,
float xmax,
448 float ymin,
float ymax, std::string folder){
450 std::map<std::string,std::pair<TH1*,string> >::iterator it;
451 it = theMap.find(name);
452 if (it == theMap.end()){
453 theMap[
name] = std::pair<TProfile*,string>(
new TProfile(name.c_str(),title.c_str(),binsx,xmin,xmax,ymin,ymax), folder);
456 theMap[
name].first->Fill(x,y);
462 int binsx,
float xmin,
float xmax,
463 float ymin,
float ymax, std::string folder){
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()){
479 theMap[
name] = std::pair<TProfile*,string>(
new TProfile(name.c_str(),title.c_str(),binsx,xmin,xmax,ymin,ymax), folder);
482 theMap[
name].first->Fill(x,y);
488 int binsx,
float xmin,
float xmax,
489 float ymin,
float ymax, std::string folder){
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()){
505 theMap[
name] = std::pair<TProfile*,string>(
new TProfile(name.c_str(),title.c_str(),binsx,xmin,xmax,ymin,ymax), folder);
508 theMap[
name].first->Fill(x,y);
514 int binsx,
float xmin,
float xmax,
515 int binsy,
float ymin,
float ymax,
516 float zmin,
float zmax, std::string folder){
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;
535 if (
id.chamber() == 36 ||
id.chamber() == 1 ||
id.chamber() == 2 ) crate = 1;
536 if (
id.chamber() == 3 ||
id.chamber() == 4 ||
id.chamber() == 5 ) crate = 2;
537 if (
id.chamber() == 6 ||
id.chamber() == 7 ||
id.chamber() == 8 ) crate = 3;
538 if (
id.chamber() == 9 ||
id.chamber() == 10 ||
id.chamber() == 11 ) crate = 4;
539 if (
id.chamber() == 12 ||
id.chamber() == 13 ||
id.chamber() == 14 ) crate = 5;
540 if (
id.chamber() == 15 ||
id.chamber() == 16 ||
id.chamber() == 17 ) crate = 6;
541 if (
id.chamber() == 18 ||
id.chamber() == 19 ||
id.chamber() == 20 ) crate = 7;
542 if (
id.chamber() == 21 ||
id.chamber() == 22 ||
id.chamber() == 23 ) crate = 8;
543 if (
id.chamber() == 24 ||
id.chamber() == 25 ||
id.chamber() == 26 ) crate = 9;
544 if (
id.chamber() == 27 ||
id.chamber() == 28 ||
id.chamber() == 29 ) crate = 10;
545 if (
id.chamber() == 30 ||
id.chamber() == 31 ||
id.chamber() == 32 ) crate = 11;
546 if (
id.chamber() == 33 ||
id.chamber() == 34 ||
id.chamber() == 35 ) crate = 12;
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)
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)
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)