CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
ME0RecHitsValidation Class Reference

#include <ME0RecHitsValidation.h>

Inheritance diagram for ME0RecHitsValidation:
ME0BaseValidation one::DQMEDAnalyzer< T > one::dqmimplementation::DQMBaseClass< T... >

Public Member Functions

void analyze (const edm::Event &e, const edm::EventSetup &) override
 
void bookHistograms (DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
 
 ME0RecHitsValidation (const edm::ParameterSet &)
 
 ~ME0RecHitsValidation () override
 
- Public Member Functions inherited from ME0BaseValidation
MonitorElementBookHistXY (DQMStore::IBooker &, const char *name, const char *label, unsigned int region_num, unsigned int layer_num=99)
 
MonitorElementBookHistZR (DQMStore::IBooker &, const char *name, const char *label, unsigned int region_num, unsigned int layer_num=99)
 
 ME0BaseValidation (const edm::ParameterSet &ps)
 
 ~ME0BaseValidation () override
 
- Public Member Functions inherited from one::DQMEDAnalyzer< T >
 DQMEDAnalyzer ()=default
 
 DQMEDAnalyzer (DQMEDAnalyzer< T... > const &)=delete
 
 DQMEDAnalyzer (DQMEDAnalyzer< T... > &&)=delete
 
 ~DQMEDAnalyzer () override=default
 

Private Attributes

edm::EDGetToken InputTagToken_RecHit
 
MonitorElementme0_rh_DeltaX [2][6]
 
MonitorElementme0_rh_DeltaY [2][6]
 
MonitorElementme0_rh_PullX [2][6]
 
MonitorElementme0_rh_PullY [2][6]
 
MonitorElementme0_rh_xy [2][6]
 
MonitorElementme0_rh_zr [2]
 
Int_t npart
 

Additional Inherited Members

- Protected Attributes inherited from ME0BaseValidation
edm::EDGetToken InputTagToken_
 
std::vector< std::string > layerLabel
 
int nBinXY_
 
std::vector< double > nBinZR_
 
std::vector< double > RangeZR_
 
std::vector< std::string > regionLabel
 

Detailed Description

Definition at line 14 of file ME0RecHitsValidation.h.

Constructor & Destructor Documentation

ME0RecHitsValidation::ME0RecHitsValidation ( const edm::ParameterSet cfg)
explicit

Definition at line 4 of file ME0RecHitsValidation.cc.

References edm::ParameterSet::getParameter(), ME0BaseValidation::InputTagToken_, and InputTagToken_RecHit.

4  : ME0BaseValidation(cfg)
5 {
6  InputTagToken_ = consumes<edm::PSimHitContainer>(cfg.getParameter<edm::InputTag>("simInputLabel"));
7  InputTagToken_RecHit = consumes<ME0RecHitCollection>(cfg.getParameter<edm::InputTag>("recHitInputLabel"));
8 }
T getParameter(std::string const &) const
edm::EDGetToken InputTagToken_RecHit
ME0BaseValidation(const edm::ParameterSet &ps)
edm::EDGetToken InputTagToken_
ME0RecHitsValidation::~ME0RecHitsValidation ( )
override

Definition at line 47 of file ME0RecHitsValidation.cc.

47  {
48 }

Member Function Documentation

void ME0RecHitsValidation::analyze ( const edm::Event e,
const edm::EventSetup iSetup 
)
overridevirtual

Implements ME0BaseValidation.

Definition at line 51 of file ME0RecHitsValidation.cc.

References relativeConstraints::chamber, gather_cfg::cout, MonitorElement::Fill(), spr::find(), edm::EventSetup::get(), edm::Event::getByToken(), hfClusterShapes_cfi::hits, mps_fire::i, triggerObjects_cff::id, ME0Geometry::idToDet(), ME0BaseValidation::InputTagToken_, InputTagToken_RecHit, edm::HandleBase::isValid(), me0_rh_DeltaX, me0_rh_DeltaY, me0_rh_PullX, me0_rh_PullY, me0_rh_xy, me0_rh_zr, or, PV3DBase< T, PVType, FrameType >::perp(), rpcPointValidation_cfi::recHit, mathSSE::return(), mathSSE::sqrt(), relativeConstraints::station, GeomDet::toGlobal(), x, PV3DBase< T, PVType, FrameType >::x(), y, PV3DBase< T, PVType, FrameType >::y(), and PV3DBase< T, PVType, FrameType >::z().

53 {
55  iSetup.get<MuonGeometryRecord>().get(hGeom);
56  const ME0Geometry* ME0Geometry_ =( &*hGeom);
58  e.getByToken(InputTagToken_, ME0Hits);
59 
61  e.getByToken(InputTagToken_RecHit, ME0RecHits);
62 
63  if (!ME0Hits.isValid() | !ME0RecHits.isValid() ) {
64  edm::LogError("ME0RecHitsValidation") << "Cannot get ME0Hits/ME0RecHits by Token simInputTagToken";
65  return ;
66  }
67 
68 
69 
70  for (auto hits=ME0Hits->begin(); hits!=ME0Hits->end(); hits++) {
71 
72  const ME0DetId id(hits->detUnitId());
73  Int_t sh_region = id.region();
74  Int_t sh_layer = id.layer();
75  Int_t sh_station = 0;
76  Int_t sh_chamber = id.chamber();
77  Int_t sh_roll = id.roll();
78 
79 
80  //Int_t even_odd = id.chamber()%2;
81  if ( ME0Geometry_->idToDet(hits->detUnitId()) == nullptr) {
82  std::cout<<"simHit did not matched with GEMGeometry."<<std::endl;
83  continue;
84  }
85 
86  const LocalPoint hitLP(hits->localPosition());
87 
88  for (ME0RecHitCollection::const_iterator recHit = ME0RecHits->begin(); recHit != ME0RecHits->end(); ++recHit)
89  {
90 
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();
95  // Float_t detId = (Short_t) (*recHit).me0Id();
96  Float_t bx = 0;
97  Float_t clusterSize = 0;
98  Float_t firstClusterStrip = 0;
99 
100  ME0DetId id((*recHit).me0Id());
101 
102  Short_t region = (Short_t) id.region();
103  Short_t station = 0;
104  Short_t layer = (Short_t) id.layer();
105  Short_t chamber = (Short_t) id.chamber();
106  Short_t roll = (Short_t) id.roll();
107 
108  LocalPoint rhLP = recHit->localPosition();
109  GlobalPoint rhGP = ME0Geometry_->idToDet((*recHit).me0Id())->surface().toGlobal(rhLP);
110 
111  Float_t globalR = rhGP.perp();
112  Float_t globalX = rhGP.x();
113  Float_t globalY = rhGP.y();
114  Float_t globalZ = rhGP.z();
115 
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);
120 
121 
122  if(bx != 0) continue;
123 
124  std::vector<int> stripsFired;
125  for(int i = firstClusterStrip; i < (firstClusterStrip + clusterSize); i++){
126 
127  stripsFired.push_back(i);
128 
129  }
130 
131 
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);
135 
136  int region_num=0 ;
137  if ( region ==-1 ) region_num = 0 ;
138  else if ( region==1) region_num = 1;
139  int layer_num = layer-1;
140 
141  if(cond1 and cond2 and cond3){
142 
143  me0_rh_xy[region_num][layer_num]->Fill(globalX,globalY);
144  me0_rh_zr[region_num]->Fill(globalZ,globalR);
145 
146  me0_rh_DeltaX[region_num][layer_num]->Fill(x_sim - x);
147  me0_rh_DeltaY[region_num][layer_num]->Fill(y_sim - y);
148  me0_rh_PullX[region_num][layer_num]->Fill(pullX);
149  me0_rh_PullY[region_num][layer_num]->Fill(pullY);
150 
151  }
152 
153  }
154 }
155 
156 }
edm::EDGetToken InputTagToken_RecHit
MonitorElement * me0_rh_DeltaX[2][6]
T perp() const
Definition: PV3DBase.h:72
MonitorElement * me0_rh_PullY[2][6]
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:579
GlobalPoint toGlobal(const Local2DPoint &lp) const
Conversion to the global R.F. from the R.F. of the GeomDet.
Definition: GeomDet.h:54
T y() const
Definition: PV3DBase.h:63
MonitorElement * me0_rh_xy[2][6]
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Definition: FindCaloHit.cc:20
MonitorElement * me0_rh_zr[2]
return((rh^lh)&mask)
void Fill(long long x)
T sqrt(T t)
Definition: SSEVec.h:18
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
Definition: Activities.doc:12
T z() const
Definition: PV3DBase.h:64
bool isValid() const
Definition: HandleBase.h:74
MonitorElement * me0_rh_PullX[2][6]
const GeomDet * idToDet(DetId) const override
Definition: ME0Geometry.cc:42
edm::EDGetToken InputTagToken_
T get() const
Definition: EventSetup.h:62
MonitorElement * me0_rh_DeltaY[2][6]
T x() const
Definition: PV3DBase.h:62
void ME0RecHitsValidation::bookHistograms ( DQMStore::IBooker ibooker,
edm::Run const &  Run,
edm::EventSetup const &  iSetup 
)
override

Definition at line 10 of file ME0RecHitsValidation.cc.

References DQMStore::IBooker::book1D(), ME0BaseValidation::BookHistXY(), ME0BaseValidation::BookHistZR(), ME0BaseValidation::layerLabel, LogDebug, me0_rh_DeltaX, me0_rh_DeltaY, me0_rh_PullX, me0_rh_PullY, me0_rh_xy, me0_rh_zr, ME0BaseValidation::regionLabel, DQMStore::IBooker::setCurrentFolder(), and AlCaHLTBitMon_QueryRunRegistry::string.

10  {
11 
12  LogDebug("MuonME0RecHitsValidation")<<"Info : Loading Geometry information\n";
13  ibooker.setCurrentFolder("MuonME0RecHitsV/ME0RecHitsTask");
14 
15  unsigned int nregion = 2;
16 
17  edm::LogInfo("MuonME0RecHitsValidation")<<"+++ Info : # of region : "<<nregion<<std::endl;
18 
19  LogDebug("MuonME0RecHitsValidation")<<"+++ Info : finish to get geometry information from ES.\n";
20 
21 
22  for( unsigned int region_num = 0 ; region_num < nregion ; region_num++ ) {
23  me0_rh_zr[region_num] = BookHistZR(ibooker,"me0_rh_tot","Digi",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);
26 
27  std::string histo_name_DeltaX = std::string("me0_rh_DeltaX_r")+regionLabel[region_num]+"_l"+layerLabel[layer_num];
28  std::string histo_name_DeltaY = std::string("me0_rh_DeltaY_r")+regionLabel[region_num]+"_l"+layerLabel[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";
31 
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);
34 
35  std::string histo_name_PullX = std::string("me0_rh_PullX_r")+regionLabel[region_num]+"_l"+layerLabel[layer_num];
36  std::string histo_name_PullY = std::string("me0_rh_PullY_r")+regionLabel[region_num]+"_l"+layerLabel[layer_num];
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";
39 
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);
42  }
43  }
44 }
#define LogDebug(id)
MonitorElement * BookHistZR(DQMStore::IBooker &, const char *name, const char *label, unsigned int region_num, unsigned int layer_num=99)
MonitorElement * me0_rh_DeltaX[2][6]
MonitorElement * me0_rh_PullY[2][6]
std::vector< std::string > layerLabel
MonitorElement * me0_rh_xy[2][6]
MonitorElement * me0_rh_zr[2]
MonitorElement * BookHistXY(DQMStore::IBooker &, const char *name, const char *label, unsigned int region_num, unsigned int layer_num=99)
void setCurrentFolder(std::string const &fullpath)
Definition: DQMStore.cc:268
MonitorElement * book1D(Args &&...args)
Definition: DQMStore.h:106
std::vector< std::string > regionLabel
MonitorElement * me0_rh_PullX[2][6]
MonitorElement * me0_rh_DeltaY[2][6]

Member Data Documentation

edm::EDGetToken ME0RecHitsValidation::InputTagToken_RecHit
private

Definition at line 31 of file ME0RecHitsValidation.h.

Referenced by analyze(), and ME0RecHitsValidation().

MonitorElement* ME0RecHitsValidation::me0_rh_DeltaX[2][6]
private

Definition at line 26 of file ME0RecHitsValidation.h.

Referenced by analyze(), and bookHistograms().

MonitorElement* ME0RecHitsValidation::me0_rh_DeltaY[2][6]
private

Definition at line 27 of file ME0RecHitsValidation.h.

Referenced by analyze(), and bookHistograms().

MonitorElement* ME0RecHitsValidation::me0_rh_PullX[2][6]
private

Definition at line 28 of file ME0RecHitsValidation.h.

Referenced by analyze(), and bookHistograms().

MonitorElement* ME0RecHitsValidation::me0_rh_PullY[2][6]
private

Definition at line 29 of file ME0RecHitsValidation.h.

Referenced by analyze(), and bookHistograms().

MonitorElement* ME0RecHitsValidation::me0_rh_xy[2][6]
private

Definition at line 23 of file ME0RecHitsValidation.h.

Referenced by analyze(), and bookHistograms().

MonitorElement* ME0RecHitsValidation::me0_rh_zr[2]
private

Definition at line 24 of file ME0RecHitsValidation.h.

Referenced by analyze(), and bookHistograms().

Int_t ME0RecHitsValidation::npart
private

Definition at line 33 of file ME0RecHitsValidation.h.