12 LogDebug(
"MuonME0RecHitsValidation")<<
"Info : Loading Geometry information\n";
15 unsigned int nregion = 2;
17 edm::LogInfo(
"MuonME0RecHitsValidation")<<
"+++ Info : # of region : "<<nregion<<std::endl;
19 LogDebug(
"MuonME0RecHitsValidation")<<
"+++ Info : finish to get geometry information from ES.\n";
22 for(
unsigned int region_num = 0 ; region_num < nregion ; region_num++ ) {
24 for(
unsigned int layer_num = 0 ; layer_num < 6 ; layer_num++) {
25 me0_rh_xy[region_num][layer_num] =
BookHistXY(ibooker,
"me0_rh",
"RecHit",region_num,layer_num);
29 std::string histo_label_DeltaX =
"RecHit Delta X : region"+
regionLabel[region_num]+
" layer "+layerLabel[layer_num]+
" "+
" ; x_{SimHit} - x_{RecHit} ; entries";
30 std::string histo_label_DeltaY =
"RecHit Delta Y : region"+
regionLabel[region_num]+
" layer "+layerLabel[layer_num]+
" "+
" ; y_{SimHit} - y_{RecHit} ; entries";
32 me0_rh_DeltaX[region_num][layer_num] = ibooker.
book1D(histo_name_DeltaX.c_str(), histo_label_DeltaX.c_str(),100,-10,10);
33 me0_rh_DeltaY[region_num][layer_num] = ibooker.
book1D(histo_name_DeltaY.c_str(), histo_label_DeltaY.c_str(),100,-10,10);
37 std::string histo_label_PullX =
"RecHit Pull X : region"+
regionLabel[region_num]+
" layer "+layerLabel[layer_num]+
" "+
" ; #frac{x_{SimHit} - x_{RecHit}}{#sigma_{x,RecHit}} ; entries";
38 std::string histo_label_PullY =
"RecHit Pull Y : region"+
regionLabel[region_num]+
" layer "+layerLabel[layer_num]+
" "+
" ; #frac{y_{SimHit} - y_{RecHit}}{#sigma_{y,RecHit}} ; entries";
40 me0_rh_PullX[region_num][layer_num] = ibooker.
book1D(histo_name_PullX.c_str(), histo_label_DeltaX.c_str(),100,-10,10);
41 me0_rh_PullY[region_num][layer_num] = ibooker.
book1D(histo_name_PullY.c_str(), histo_label_DeltaY.c_str(),100,-10,10);
64 edm::LogError(
"ME0RecHitsValidation") <<
"Cannot get ME0Hits/ME0RecHits by Token simInputTagToken";
70 for (
auto hits=ME0Hits->begin();
hits!=ME0Hits->end();
hits++) {
73 Int_t sh_region =
id.region();
74 Int_t sh_layer =
id.layer();
76 Int_t sh_chamber =
id.chamber();
77 Int_t sh_roll =
id.roll();
81 if ( ME0Geometry_->
idToDet(
hits->detUnitId()) ==
nullptr) {
82 std::cout<<
"simHit did not matched with GEMGeometry."<<std::endl;
91 Float_t
x =
recHit->localPosition().x();
92 Float_t xErr =
recHit->localPositionError().xx();
93 Float_t
y =
recHit->localPosition().y();
94 Float_t yErr =
recHit->localPositionError().yy();
97 Float_t clusterSize = 0;
98 Float_t firstClusterStrip = 0;
102 Short_t region = (Short_t)
id.region();
104 Short_t layer = (Short_t)
id.layer();
106 Short_t roll = (Short_t)
id.roll();
111 Float_t globalR = rhGP.
perp();
112 Float_t globalX = rhGP.
x();
113 Float_t globalY = rhGP.
y();
114 Float_t globalZ = rhGP.
z();
116 Float_t x_sim = hitLP.x();
117 Float_t y_sim = hitLP.y();
118 Float_t pullX = (x_sim -
x) /
sqrt(xErr);
119 Float_t pullY = (y_sim -
y) /
sqrt(yErr);
122 if(bx != 0)
continue;
124 std::vector<int> stripsFired;
125 for(
int i = firstClusterStrip;
i < (firstClusterStrip + clusterSize);
i++){
127 stripsFired.push_back(
i);
132 const bool cond1(sh_region==region and sh_layer==layer and sh_station==station);
133 const bool cond2(sh_chamber==chamber and sh_roll==roll);
134 const bool cond3((
std::find(stripsFired.begin(), stripsFired.end(), (firstClusterStrip + 1)) != stripsFired.end())
or clusterSize==0);
137 if ( region ==-1 ) region_num = 0 ;
138 else if ( region==1) region_num = 1;
139 int layer_num = layer-1;
141 if(cond1 and cond2 and cond3){
MonitorElement * BookHistZR(DQMStore::IBooker &, const char *name, const char *label, unsigned int region_num, unsigned int layer_num=99)
T getParameter(std::string const &) const
edm::EDGetToken InputTagToken_RecHit
MonitorElement * me0_rh_DeltaX[2][6]
MonitorElement * me0_rh_PullY[2][6]
~ME0RecHitsValidation() override
bool getByToken(EDGetToken token, Handle< PROD > &result) const
GlobalPoint toGlobal(const Local2DPoint &lp) const
Conversion to the global R.F. from the R.F. of the GeomDet.
std::vector< std::string > layerLabel
void analyze(const edm::Event &e, const edm::EventSetup &) override
MonitorElement * me0_rh_xy[2][6]
void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
ME0RecHitsValidation(const edm::ParameterSet &)
MonitorElement * me0_rh_zr[2]
MonitorElement * BookHistXY(DQMStore::IBooker &, const char *name, const char *label, unsigned int region_num, unsigned int layer_num=99)
The Signals That Services Can Subscribe To This is based on ActivityRegistry and is current per Services can connect to the signals distributed by the ActivityRegistry in order to monitor the activity of the application Each possible callback has some defined which we here list in angle e< void, edm::EventID const &, edm::Timestamp const & > We also list in braces which AR_WATCH_USING_METHOD_ is used for those or
MonitorElement * book1D(Args &&...args)
std::vector< std::string > regionLabel
void setCurrentFolder(const std::string &fullpath)
MonitorElement * me0_rh_PullX[2][6]
const GeomDet * idToDet(DetId) const override
edm::EDGetToken InputTagToken_
return(e1-e2)*(e1-e2)+dp *dp
MonitorElement * me0_rh_DeltaY[2][6]