Skip to content

Commit

Permalink
Merge pull request #3 from jedori0228/gem-sim-validation-porting
Browse files Browse the repository at this point in the history
even/odd for pad/copad
  • Loading branch information
geonmo committed May 4, 2015
2 parents 37becd4 + 99f1f65 commit 618924a
Show file tree
Hide file tree
Showing 4 changed files with 45 additions and 20 deletions.
5 changes: 1 addition & 4 deletions Validation/MuonGEMDigis/interface/GEMCoPadDigiValidation.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,11 @@ class GEMCoPadDigiValidation : public GEMBaseValidation
private:

MonitorElement* theCSCCoPad_xy[2][3];

MonitorElement* theCSCCoPad_phipad[2][3];

MonitorElement* theCSCCoPad[2][3];

MonitorElement* theCSCCoPad_bx[2][3];

MonitorElement* theCSCCoPad_zr[2][3];
std::map< UInt_t , MonitorElement* > theCSCCoPad_xy_ch;

};

Expand Down
2 changes: 1 addition & 1 deletion Validation/MuonGEMDigis/interface/GEMPadDigiValidation.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class GEMPadDigiValidation : public GEMBaseValidation
MonitorElement* theCSCPad[2][3][2];
MonitorElement* theCSCPad_bx[2][3][2];
MonitorElement* theCSCPad_zr[2][3][2];

std::map< UInt_t , MonitorElement* > theCSCPad_xy_ch;
};

#endif
44 changes: 29 additions & 15 deletions Validation/MuonGEMDigis/src/GEMCoPadDigiValidation.cc
Original file line number Diff line number Diff line change
Expand Up @@ -29,20 +29,28 @@ void GEMCoPadDigiValidation::bookHistograms(DQMStore::IBooker & ibooker, edm::Ru
npadsGE21 = GEMGeometry_->regions()[0]->stations()[1]->superChambers()[0]->chambers()[0]->etaPartitions()[0]->npads();
}
for( int region_num = 0 ; region_num < nregions ; region_num++ ) {
std::string name_prefix = std::string("_r")+regionLabel[region_num];
std::string label_prefix = "region "+regionLabel[region_num];
for( int station_num = 0 ; station_num < nstations ; station_num++) {
if ( station_num == 0 ) nPads = npadsGE11;
else nPads = npadsGE21;
name_prefix = std::string("_r")+regionLabel[region_num]+"_st"+stationLabel[station_num];
label_prefix = "region"+regionLabel[region_num]+" station "+stationLabel[station_num];
theCSCCoPad_phipad[region_num][station_num] = ibooker.book2D( ("copad_dg_phipad"+name_prefix).c_str(), ("Digi occupancy: "+label_prefix+"; phi [rad]; Pad number").c_str(), 280,-PI,PI, nPads/2,0,nPads );
theCSCCoPad[region_num][station_num] = ibooker.book1D( ("copad_dg"+name_prefix).c_str(), ("Digi occupancy per pad number: "+label_prefix+";Pad number; entries").c_str(), nPads,0.5,nPads+0.5);
theCSCCoPad_bx[region_num][station_num] = ibooker.book1D( ("copad_dg_bx"+name_prefix).c_str(), ("Bunch crossing: "+label_prefix+"; bunch crossing ; entries").c_str(), 11,-5.5,5.5);
theCSCCoPad_zr[region_num][station_num] = BookHistZR( ibooker, "copad_dg","CoPad Digi",region_num,station_num);
theCSCCoPad_xy[region_num][station_num] = BookHistXY( ibooker, "copad_dg","CoPad Digi",region_num,station_num);
}
}
std::string name_prefix = std::string("_r")+regionLabel[region_num];
std::string label_prefix = "region "+regionLabel[region_num];
for( int station_num = 0 ; station_num < nstations ; station_num++) {
if ( station_num == 0 ) nPads = npadsGE11;
else nPads = npadsGE21;
name_prefix = std::string("_r")+regionLabel[region_num]+"_st"+stationLabel[station_num];
label_prefix = "region"+regionLabel[region_num]+" station "+stationLabel[station_num];
theCSCCoPad_phipad[region_num][station_num] = ibooker.book2D( ("copad_dg_phipad"+name_prefix).c_str(), ("Digi occupancy: "+label_prefix+"; phi [rad]; Pad number").c_str(), 280,-PI,PI, nPads/2,0,nPads );
theCSCCoPad[region_num][station_num] = ibooker.book1D( ("copad_dg"+name_prefix).c_str(), ("Digi occupancy per pad number: "+label_prefix+";Pad number; entries").c_str(), nPads,0.5,nPads+0.5);
theCSCCoPad_bx[region_num][station_num] = ibooker.book1D( ("copad_dg_bx"+name_prefix).c_str(), ("Bunch crossing: "+label_prefix+"; bunch crossing ; entries").c_str(), 11,-5.5,5.5);
theCSCCoPad_zr[region_num][station_num] = BookHistZR( ibooker, "copad_dg","CoPad Digi",region_num,station_num);
theCSCCoPad_xy[region_num][station_num] = BookHistXY( ibooker, "copad_dg","CoPad Digi",region_num,station_num);
TString xy_name = TString::Format("copad_dg_xy%s_odd",name_prefix.c_str());
TString xy_title = TString::Format("Digi XY occupancy %s at odd chambers",label_prefix.c_str());
theCSCCoPad_xy_ch[ xy_name.Hash()] = ibooker.book2D(xy_name, xy_title, 360, -360,360, 360, -360, 360);
std::cout<<xy_name<<" "<<xy_name.Hash()<<std::endl;
xy_name = TString::Format("copad_dg_xy%s_even",name_prefix.c_str());
xy_title = TString::Format("Digi XY occupancy %s at even chambers",label_prefix.c_str());
theCSCCoPad_xy_ch[ xy_name.Hash()] = ibooker.book2D(xy_name, xy_title, 360, -360,360, 360, -360, 360);
std::cout<<xy_name<<" "<<xy_name.Hash()<<std::endl;
}
}
}


Expand Down Expand Up @@ -84,6 +92,7 @@ void GEMCoPadDigiValidation::analyze(const edm::Event& e,

Short_t region = (Short_t) id.region();
Short_t station = (Short_t) id.station();
Short_t chamber = (Short_t) id.chamber();

GEMCoPadDigiCollection::const_iterator digiItr;
//loop over digis of given roll
Expand Down Expand Up @@ -119,6 +128,11 @@ void GEMCoPadDigiValidation::analyze(const edm::Event& e,
theCSCCoPad[region_num][station_num]->Fill(pad);
theCSCCoPad_bx[region_num][station_num]->Fill(bx);
theCSCCoPad_zr[region_num][station_num]->Fill(g_z,g_r);
}
std::string name_prefix = std::string("_r")+regionLabel[region_num]+"_st"+stationLabel[station_num];
TString hname;
if ( chamber %2 == 0 ) { hname = TString::Format("copad_dg_xy%s_even",name_prefix.c_str()); }
else { hname = TString::Format("copad_dg_xy%s_odd",name_prefix.c_str()); }
theCSCCoPad_xy_ch[hname.Hash()]->Fill(g_x,g_y);
}
}
}
14 changes: 14 additions & 0 deletions Validation/MuonGEMDigis/src/GEMPadDigiValidation.cc
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,14 @@ void GEMPadDigiValidation::bookHistograms(DQMStore::IBooker & ibooker, edm::Run
theCSCPad_bx[region_num][station_num][layer_num] = ibooker.book1D( ("pad_dg_bx"+name_prefix).c_str(), ("Bunch crossing: "+label_prefix+"; bunch crossing ; entries").c_str(), 11,-5.5,5.5);
theCSCPad_zr[region_num][station_num][layer_num] = BookHistZR(ibooker,"pad_dg","Pad Digi",region_num,station_num,layer_num);
theCSCPad_xy[region_num][station_num][layer_num] = BookHistXY(ibooker,"pad_dg","Pad Digi",region_num,station_num,layer_num);
TString xy_name = TString::Format("pad_dg_xy%s_odd",name_prefix.c_str());
TString xy_title = TString::Format("Digi XY occupancy %s at odd chambers",label_prefix.c_str());
theCSCPad_xy_ch[ xy_name.Hash()] = ibooker.book2D(xy_name, xy_title, 360, -360,360, 360, -360, 360);
std::cout<<xy_name<<" "<<xy_name.Hash()<<std::endl;
xy_name = TString::Format("pad_dg_xy%s_even",name_prefix.c_str());
xy_title = TString::Format("Digi XY occupancy %s at even chambers",label_prefix.c_str());
theCSCPad_xy_ch[ xy_name.Hash()] = ibooker.book2D(xy_name, xy_title, 360, -360,360, 360, -360, 360);
std::cout<<xy_name<<" "<<xy_name.Hash()<<std::endl;
}
}
}
Expand Down Expand Up @@ -85,6 +93,7 @@ void GEMPadDigiValidation::analyze(const edm::Event& e,
Short_t region = (Short_t) id.region();
Short_t layer = (Short_t) id.layer();
Short_t station = (Short_t) id.station();
Short_t chamber = (Short_t) id.chamber();
GEMPadDigiCollection::const_iterator digiItr;
//loop over digis of given roll
for (digiItr = (*cItr ).second.first; digiItr != (*cItr ).second.second; ++digiItr)
Expand Down Expand Up @@ -115,6 +124,11 @@ void GEMPadDigiValidation::analyze(const edm::Event& e,
theCSCPad[region_num][station_num][layer_num]->Fill(pad);
theCSCPad_bx[region_num][station_num][layer_num]->Fill(bx);
theCSCPad_zr[region_num][station_num][layer_num]->Fill(g_z,g_r);
std::string name_prefix = std::string("_r")+regionLabel[region_num]+"_st"+stationLabel[station_num] + "_l"+layerLabel[layer_num];
TString hname;
if ( chamber %2 == 0 ) { hname = TString::Format("pad_dg_xy%s_even",name_prefix.c_str()); }
else { hname = TString::Format("pad_dg_xy%s_odd",name_prefix.c_str()); }
theCSCPad_xy_ch[hname.Hash()]->Fill(g_x,g_y);
}
}
}

0 comments on commit 618924a

Please sign in to comment.