CMS 3D CMS Logo

List of all members | Classes | Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes
Phase2ITValidateRecHitBase Class Reference

#include <Phase2ITValidateRecHitBase.h>

Inheritance diagram for Phase2ITValidateRecHitBase:
DQMEDAnalyzer edm::stream::EDProducer< edm::GlobalCache< DQMEDAnalyzerGlobalCache >, edm::EndRunProducer, edm::EndLuminosityBlockProducer, edm::Accumulator > Phase2ITValidateRecHit Phase2ITValidateTrackingRecHit

Classes

struct  RecHitME
 

Public Member Functions

void bookHistograms (DQMStore::IBooker &ibooker, edm::Run const &iRun, edm::EventSetup const &iSetup) override
 
void dqmBeginRun (const edm::Run &, const edm::EventSetup &) override
 
 Phase2ITValidateRecHitBase (const edm::ParameterSet &)
 
 ~Phase2ITValidateRecHitBase () override
 
- Public Member Functions inherited from DQMEDAnalyzer
void accumulate (edm::Event const &event, edm::EventSetup const &setup) final
 
virtual void analyze (edm::Event const &, edm::EventSetup const &)
 
void beginLuminosityBlock (edm::LuminosityBlock const &lumi, edm::EventSetup const &setup) final
 
void beginRun (edm::Run const &run, edm::EventSetup const &setup) final
 
void beginStream (edm::StreamID id) final
 
 DQMEDAnalyzer ()
 
void endLuminosityBlock (edm::LuminosityBlock const &lumi, edm::EventSetup const &setup) final
 
void endRun (edm::Run const &run, edm::EventSetup const &setup) final
 
virtual bool getCanSaveByLumi ()
 
- Public Member Functions inherited from edm::stream::EDProducer< edm::GlobalCache< DQMEDAnalyzerGlobalCache >, edm::EndRunProducer, edm::EndLuminosityBlockProducer, edm::Accumulator >
 EDProducer ()=default
 
 EDProducer (const EDProducer &)=delete
 
bool hasAbilityToProduceInBeginLumis () const final
 
bool hasAbilityToProduceInBeginProcessBlocks () const final
 
bool hasAbilityToProduceInBeginRuns () const final
 
bool hasAbilityToProduceInEndLumis () const final
 
bool hasAbilityToProduceInEndProcessBlocks () const final
 
bool hasAbilityToProduceInEndRuns () const final
 
const EDProduceroperator= (const EDProducer &)=delete
 

Static Public Member Functions

static void fillPSetDescription (edm::ParameterSetDescription &desc)
 
- Static Public Member Functions inherited from DQMEDAnalyzer
static void globalEndJob (DQMEDAnalyzerGlobalCache const *)
 
static void globalEndLuminosityBlockProduce (edm::LuminosityBlock &lumi, edm::EventSetup const &setup, LuminosityBlockContext const *context)
 
static void globalEndRunProduce (edm::Run &run, edm::EventSetup const &setup, RunContext const *context)
 
static std::unique_ptr< DQMEDAnalyzerGlobalCacheinitializeGlobalCache (edm::ParameterSet const &)
 

Protected Member Functions

void bookLayerHistos (DQMStore::IBooker &ibooker, unsigned int det_id, std::string &subdir)
 
void fillRechitHistos (const PSimHit *simhitClosest, const SiPixelRecHit *rechit, const std::map< unsigned int, SimTrack > &selectedSimTrackMap, std::map< std::string, unsigned int > &nrechitLayerMap_primary)
 
- Protected Member Functions inherited from DQMEDAnalyzer
uint64_t meId () const
 

Protected Attributes

edm::ParameterSet config_
 
const edm::ESGetToken< TrackerGeometry, TrackerDigiGeometryRecordgeomToken_
 
std::map< std::string, RecHitMElayerMEs_
 
const TrackerGeometrytkGeom_ = nullptr
 
const edm::ESGetToken< TrackerTopology, TrackerTopologyRcdtopoToken_
 
const TrackerTopologytTopo_ = nullptr
 
- Protected Attributes inherited from DQMEDAnalyzer
edm::EDPutTokenT< DQMTokenlumiToken_
 
edm::EDPutTokenT< DQMTokenrunToken_
 
unsigned int streamId_
 

Additional Inherited Members

- Public Types inherited from DQMEDAnalyzer
typedef dqm::reco::DQMStore DQMStore
 
typedef dqm::reco::MonitorElement MonitorElement
 
- Public Types inherited from edm::stream::EDProducer< edm::GlobalCache< DQMEDAnalyzerGlobalCache >, edm::EndRunProducer, edm::EndLuminosityBlockProducer, edm::Accumulator >
using CacheTypes = CacheContexts< T... >
 
using GlobalCache = typename CacheTypes::GlobalCache
 
using HasAbility = AbilityChecker< T... >
 
using InputProcessBlockCache = typename CacheTypes::InputProcessBlockCache
 
using LuminosityBlockCache = typename CacheTypes::LuminosityBlockCache
 
using LuminosityBlockContext = LuminosityBlockContextT< LuminosityBlockCache, RunCache, GlobalCache >
 
using LuminosityBlockSummaryCache = typename CacheTypes::LuminosityBlockSummaryCache
 
using RunCache = typename CacheTypes::RunCache
 
using RunContext = RunContextT< RunCache, GlobalCache >
 
using RunSummaryCache = typename CacheTypes::RunSummaryCache
 

Detailed Description

Description: Base Class for Phase2 Validation

Definition at line 41 of file Phase2ITValidateRecHitBase.h.

Constructor & Destructor Documentation

◆ Phase2ITValidateRecHitBase()

Phase2ITValidateRecHitBase::Phase2ITValidateRecHitBase ( const edm::ParameterSet iConfig)
explicit

Definition at line 18 of file Phase2ITValidateRecHitBase.cc.

19  : config_(iConfig),
20  geomToken_(esConsumes<TrackerGeometry, TrackerDigiGeometryRecord, edm::Transition::BeginRun>()),
21  topoToken_(esConsumes<TrackerTopology, TrackerTopologyRcd, edm::Transition::BeginRun>()) {
22  edm::LogInfo("Phase2ITValidateRecHitBase") << ">>> Construct Phase2ITValidateRecHitBase ";
23 }
Log< level::Info, false > LogInfo
const edm::ESGetToken< TrackerTopology, TrackerTopologyRcd > topoToken_
const edm::ESGetToken< TrackerGeometry, TrackerDigiGeometryRecord > geomToken_

◆ ~Phase2ITValidateRecHitBase()

Phase2ITValidateRecHitBase::~Phase2ITValidateRecHitBase ( )
overridedefault

Member Function Documentation

◆ bookHistograms()

void Phase2ITValidateRecHitBase::bookHistograms ( DQMStore::IBooker ibooker,
edm::Run const &  iRun,
edm::EventSetup const &  iSetup 
)
overridevirtual

Implements DQMEDAnalyzer.

Definition at line 32 of file Phase2ITValidateRecHitBase.cc.

References bookLayerHistos(), edm::ESWatcher< T >::check(), config_, TrackerGeometry::detUnits(), edm::ParameterSet::getParameter(), GeomDetEnumerators::P2PXB, GeomDetEnumerators::P2PXEC, AlCaHLTBitMon_QueryRunRegistry::string, and tkGeom_.

34  {
35  std::string top_folder = config_.getParameter<std::string>("TopFolderName");
36  edm::LogInfo("Phase2ITValidateRecHitBase") << " Booking Histograms in : " << top_folder;
37  edm::ESWatcher<TrackerDigiGeometryRecord> theTkDigiGeomWatcher;
38  if (theTkDigiGeomWatcher.check(iSetup)) {
39  for (auto const& det_u : tkGeom_->detUnits()) {
40  //Always check TrackerNumberingBuilder before changing this part
41  if (!(det_u->subDetector() == GeomDetEnumerators::SubDetector::P2PXB ||
42  det_u->subDetector() == GeomDetEnumerators::SubDetector::P2PXEC))
43  continue;
44  unsigned int detId_raw = det_u->geographicalId().rawId();
45  bookLayerHistos(ibooker, detId_raw, top_folder);
46  }
47  }
48 }
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
const DetContainer & detUnits() const override
Returm a vector of all GeomDet.
void bookLayerHistos(DQMStore::IBooker &ibooker, unsigned int det_id, std::string &subdir)
Log< level::Info, false > LogInfo
bool check(const edm::EventSetup &iSetup)
Definition: ESWatcher.h:57

◆ bookLayerHistos()

void Phase2ITValidateRecHitBase::bookLayerHistos ( DQMStore::IBooker ibooker,
unsigned int  det_id,
std::string &  subdir 
)
protected

Definition at line 51 of file Phase2ITValidateRecHitBase.cc.

References phase2tkutil::book1DFromPSet(), phase2tkutil::book2DFromPSet(), phase2tkutil::bookProfile1DFromPSet(), dqm::implementation::NavigatorBase::cd(), config_, Phase2ITValidateRecHitBase::RecHitME::deltaX, Phase2ITValidateRecHitBase::RecHitME::deltaX_clsizex, Phase2ITValidateRecHitBase::RecHitME::deltaX_clsizey, Phase2ITValidateRecHitBase::RecHitME::deltaX_eta, Phase2ITValidateRecHitBase::RecHitME::deltaX_phi, Phase2ITValidateRecHitBase::RecHitME::deltaX_primary, Phase2ITValidateRecHitBase::RecHitME::deltaY, Phase2ITValidateRecHitBase::RecHitME::deltaY_clsizex, Phase2ITValidateRecHitBase::RecHitME::deltaY_clsizey, Phase2ITValidateRecHitBase::RecHitME::deltaY_eta, Phase2ITValidateRecHitBase::RecHitME::deltaY_phi, Phase2ITValidateRecHitBase::RecHitME::deltaY_primary, Phase2ITValidateRecHitBase::RecHitME::deltaYvsdeltaX, phase2tkutil::getITHistoId(), edm::ParameterSet::getParameter(), crabWrapper::key, layerMEs_, Phase2ITValidateRecHitBase::RecHitME::numberRecHitsprimary, Phase2ITValidateRecHitBase::RecHitME::pullX, Phase2ITValidateRecHitBase::RecHitME::pullX_eta, Phase2ITValidateRecHitBase::RecHitME::pullX_primary, Phase2ITValidateRecHitBase::RecHitME::pullY, Phase2ITValidateRecHitBase::RecHitME::pullY_eta, Phase2ITValidateRecHitBase::RecHitME::pullY_primary, dqm::implementation::NavigatorBase::setCurrentFolder(), AlCaHLTBitMon_QueryRunRegistry::string, mkLumiAveragedPlots::subdir, and tTopo_.

Referenced by bookHistograms().

51  {
52  ibooker.cd();
54  if (key.empty())
55  return;
56  if (layerMEs_.find(key) == layerMEs_.end()) {
57  ibooker.cd();
58  RecHitME local_histos;
59  ibooker.setCurrentFolder(subdir + "/" + key);
60  edm::LogInfo("Phase2ITValidateRecHit") << " Booking Histograms in : " << (subdir + "/" + key);
61 
62  local_histos.deltaX = phase2tkutil::book1DFromPSet(config_.getParameter<edm::ParameterSet>("DeltaX"), ibooker);
63 
64  local_histos.deltaY = phase2tkutil::book1DFromPSet(config_.getParameter<edm::ParameterSet>("DeltaY"), ibooker);
65 
66  local_histos.pullX = phase2tkutil::book1DFromPSet(config_.getParameter<edm::ParameterSet>("PullX"), ibooker);
67 
68  local_histos.pullY = phase2tkutil::book1DFromPSet(config_.getParameter<edm::ParameterSet>("PullY"), ibooker);
69 
70  local_histos.deltaX_eta =
72 
73  local_histos.deltaX_phi =
75 
76  local_histos.deltaY_eta =
78 
79  local_histos.deltaY_phi =
81 
82  local_histos.deltaX_clsizex =
84 
85  local_histos.deltaX_clsizey =
87 
88  local_histos.deltaY_clsizex =
90 
91  local_histos.deltaY_clsizey =
93 
94  local_histos.deltaYvsdeltaX =
96 
97  local_histos.pullX_eta =
99 
100  local_histos.pullY_eta =
102  ibooker.setCurrentFolder(subdir + "/" + key + "/PrimarySimHits");
103  //all histos for Primary particles
104  local_histos.numberRecHitsprimary =
106 
107  local_histos.deltaX_primary =
109 
110  local_histos.deltaY_primary =
112 
113  local_histos.pullX_primary =
115 
116  local_histos.pullY_primary =
118 
119  layerMEs_.emplace(key, local_histos);
120  }
121 }
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
MonitorElement * book2DFromPSet(const edm::ParameterSet &hpars, DQMStore::IBooker &ibooker)
std::map< std::string, RecHitME > layerMEs_
virtual void setCurrentFolder(std::string const &fullpath)
Definition: DQMStore.cc:36
MonitorElement * bookProfile1DFromPSet(const edm::ParameterSet &hpars, DQMStore::IBooker &ibooker)
std::string getITHistoId(uint32_t det_id, const TrackerTopology *tTopo)
MonitorElement * book1DFromPSet(const edm::ParameterSet &hpars, DQMStore::IBooker &ibooker)
Log< level::Info, false > LogInfo

◆ dqmBeginRun()

void Phase2ITValidateRecHitBase::dqmBeginRun ( const edm::Run iRun,
const edm::EventSetup iSetup 
)
overridevirtual

Reimplemented from DQMEDAnalyzer.

Definition at line 25 of file Phase2ITValidateRecHitBase.cc.

References geomToken_, edm::EventSetup::getData(), tkGeom_, topoToken_, and tTopo_.

25  {
26  tkGeom_ = &iSetup.getData(geomToken_);
27  tTopo_ = &iSetup.getData(topoToken_);
28 }
T const & getData(const ESGetToken< T, R > &iToken) const noexcept(false)
Definition: EventSetup.h:119
const edm::ESGetToken< TrackerTopology, TrackerTopologyRcd > topoToken_
const edm::ESGetToken< TrackerGeometry, TrackerDigiGeometryRecord > geomToken_

◆ fillPSetDescription()

void Phase2ITValidateRecHitBase::fillPSetDescription ( edm::ParameterSetDescription desc)
static

Definition at line 179 of file Phase2ITValidateRecHitBase.cc.

References edm::ParameterSetDescription::add(), submitPVResolutionJobs::desc, M_PI, and AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by Phase2ITValidateRecHit::fillDescriptions(), and Phase2ITValidateTrackingRecHit::fillDescriptions().

179  {
181  psd0.add<std::string>("name", "Delta_X");
182  psd0.add<std::string>("title", "Delta_X;RecHit resolution X coordinate [#mum]");
183  psd0.add<bool>("switch", true);
184  psd0.add<double>("xmin", -100.0);
185  psd0.add<double>("xmax", 100.0);
186  psd0.add<int>("NxBins", 100);
187  desc.add<edm::ParameterSetDescription>("DeltaX", psd0);
188 
190  psd1.add<std::string>("name", "Delta_Y");
191  psd1.add<std::string>("title", "Delta_Y;RecHit resolution Y coordinate [#mum];");
192  psd1.add<bool>("switch", true);
193  psd1.add<double>("xmin", -100.0);
194  psd1.add<double>("xmax", 100.0);
195  psd1.add<int>("NxBins", 100);
196  desc.add<edm::ParameterSetDescription>("DeltaY", psd1);
197 
199  psd2.add<std::string>("name", "Pull_X");
200  psd2.add<std::string>("title", "Pull_X;pull x;");
201  psd2.add<double>("xmin", -4.0);
202  psd2.add<bool>("switch", true);
203  psd2.add<double>("xmax", 4.0);
204  psd2.add<int>("NxBins", 100);
205  desc.add<edm::ParameterSetDescription>("PullX", psd2);
206 
208  psd3.add<std::string>("name", "Pull_Y");
209  psd3.add<std::string>("title", "Pull_Y;pull y;");
210  psd3.add<double>("xmin", -4.0);
211  psd3.add<bool>("switch", true);
212  psd3.add<double>("xmax", 4.0);
213  psd3.add<int>("NxBins", 100);
214  desc.add<edm::ParameterSetDescription>("PullY", psd3);
215 
217  psd4.add<std::string>("name", "Delta_X_vs_Eta");
218  psd4.add<std::string>("title", "Delta_X_vs_Eta;|#eta|;#Delta x [#mum]");
219  psd4.add<int>("NyBins", 100);
220  psd4.add<double>("ymin", -100.0);
221  psd4.add<double>("ymax", 100.0);
222  psd4.add<int>("NxBins", 41);
223  psd4.add<bool>("switch", true);
224  psd4.add<double>("xmax", 4.1);
225  psd4.add<double>("xmin", 0.);
226  desc.add<edm::ParameterSetDescription>("DeltaX_eta", psd4);
227 
229  psd4_y.add<std::string>("name", "Delta_X_vs_Phi");
230  ;
231  psd4_y.add<std::string>("title", "Delta_X_vs_Phi;#phi;#Delta x [#mum]");
232  psd4_y.add<int>("NyBins", 100);
233  psd4_y.add<double>("ymin", -100.0);
234  psd4_y.add<double>("ymax", 100.0);
235  psd4_y.add<int>("NxBins", 36);
236  psd4_y.add<bool>("switch", true);
237  psd4_y.add<double>("xmax", M_PI);
238  psd4_y.add<double>("xmin", -M_PI);
239  desc.add<edm::ParameterSetDescription>("DeltaX_phi", psd4_y);
240 
242  psd5.add<std::string>("name", "Delta_Y_vs_Eta");
243  psd5.add<std::string>("title", "Delta_Y_vs_Eta;|#eta|;#Delta y [#mum]");
244  psd5.add<int>("NyBins", 100);
245  psd5.add<double>("ymin", -100.0);
246  psd5.add<double>("ymax", 100.0);
247  psd5.add<int>("NxBins", 41);
248  psd5.add<bool>("switch", true);
249  psd5.add<double>("xmax", 4.1);
250  psd5.add<double>("xmin", 0.);
251  desc.add<edm::ParameterSetDescription>("DeltaY_eta", psd5);
252 
254  psd5_y.add<std::string>("name", "Delta_Y_vs_Phi");
255  psd5_y.add<std::string>("title", "Delta_Y_vs_Phi;#phi;#Delta y [#mum]");
256  psd5_y.add<int>("NyBins", 100);
257  psd5_y.add<double>("ymin", -100.0);
258  psd5_y.add<double>("ymax", 100.0);
259  psd5_y.add<int>("NxBins", 36);
260  psd5_y.add<bool>("switch", true);
261  psd5_y.add<double>("xmax", M_PI);
262  psd5_y.add<double>("xmin", -M_PI);
263  desc.add<edm::ParameterSetDescription>("DeltaY_phi", psd5_y);
264 
266  psd6.add<std::string>("name", "Delta_X_vs_ClusterSizeX");
267  psd6.add<std::string>("title", ";Cluster size X;#Delta x [#mum]");
268  psd6.add<double>("ymin", -100.0);
269  psd6.add<double>("ymax", 100.0);
270  psd6.add<int>("NxBins", 21);
271  psd6.add<bool>("switch", true);
272  psd6.add<double>("xmax", 20.5);
273  psd6.add<double>("xmin", -0.5);
274  desc.add<edm::ParameterSetDescription>("DeltaX_clsizex", psd6);
275 
277  psd7.add<std::string>("name", "Delta_X_vs_ClusterSizeY");
278  psd7.add<std::string>("title", ";Cluster size Y;#Delta x [#mum]");
279  psd7.add<double>("ymin", -100.0);
280  psd7.add<double>("ymax", 100.0);
281  psd7.add<int>("NxBins", 21);
282  psd7.add<bool>("switch", true);
283  psd7.add<double>("xmax", 20.5);
284  psd7.add<double>("xmin", -0.5);
285  desc.add<edm::ParameterSetDescription>("DeltaX_clsizey", psd7);
286 
288  psd8.add<std::string>("name", "Delta_Y_vs_ClusterSizeX");
289  psd8.add<std::string>("title", ";Cluster size X;#Delta y [#mum]");
290  psd8.add<double>("ymin", -100.0);
291  psd8.add<double>("ymax", 100.0);
292  psd8.add<int>("NxBins", 21);
293  psd8.add<bool>("switch", true);
294  psd8.add<double>("xmax", 20.5);
295  psd8.add<double>("xmin", -0.5);
296  desc.add<edm::ParameterSetDescription>("DeltaY_clsizex", psd8);
297 
299  psd9.add<std::string>("name", "Delta_Y_vs_ClusterSizeY");
300  psd9.add<std::string>("title", ";Cluster size Y;#Delta y [#mum]");
301  psd9.add<double>("ymin", -100.0);
302  psd9.add<double>("ymax", 100.0);
303  psd9.add<int>("NxBins", 21);
304  psd9.add<bool>("switch", true);
305  psd9.add<double>("xmax", 20.5);
306  psd9.add<double>("xmin", -0.5);
307  desc.add<edm::ParameterSetDescription>("DeltaY_clsizey", psd9);
308 
310  psd10.add<std::string>("name", "Delta_Y_vs_DeltaX");
311  psd10.add<std::string>("title", ";#Delta x[#mum];#Delta y[#mum]");
312  psd10.add<bool>("switch", true);
313  psd10.add<double>("ymin", -100.0);
314  psd10.add<double>("ymax", 100.0);
315  psd10.add<int>("NyBins", 100);
316  psd10.add<double>("xmax", 100.);
317  psd10.add<double>("xmin", -100.);
318  psd10.add<int>("NxBins", 100);
319  desc.add<edm::ParameterSetDescription>("DeltaY_vs_DeltaX", psd10);
320 
322  psd11.add<std::string>("name", "Pull_X_vs_Eta");
323  psd11.add<std::string>("title", "Pull_X_vs_Eta;#eta;pull x");
324  psd11.add<double>("ymax", 4.0);
325  psd11.add<int>("NxBins", 82);
326  psd11.add<bool>("switch", true);
327  psd11.add<double>("xmax", 4.1);
328  psd11.add<double>("xmin", -4.1);
329  psd11.add<double>("ymin", -4.0);
330  desc.add<edm::ParameterSetDescription>("PullX_eta", psd11);
331 
333  psd12.add<std::string>("name", "Pull_Y_vs_Eta");
334  psd12.add<std::string>("title", "Pull_Y_vs_Eta;#eta;pull y");
335  psd12.add<double>("ymax", 4.0);
336  psd12.add<int>("NxBins", 82);
337  psd12.add<bool>("switch", true);
338  psd12.add<double>("xmax", 4.1);
339  psd12.add<double>("xmin", -4.1);
340  psd12.add<double>("ymin", -4.0);
341  desc.add<edm::ParameterSetDescription>("PullY_eta", psd12);
342 
343  //simhits primary
344 
346  psd13.add<std::string>("name", "Number_RecHits_matched_PrimarySimTrack");
347  psd13.add<std::string>("title", "Number of RecHits matched to primary SimTrack;;");
348  psd13.add<double>("xmin", 0.0);
349  psd13.add<bool>("switch", true);
350  psd13.add<double>("xmax", 0.0);
351  psd13.add<int>("NxBins", 100);
352  desc.add<edm::ParameterSetDescription>("nRecHits_primary", psd13);
353 
355  psd14.add<std::string>("name", "Delta_X_SimHitPrimary");
356  psd14.add<std::string>("title", "Delta_X_SimHitPrimary;#delta x [#mum];");
357  psd14.add<double>("xmin", -100.0);
358  psd14.add<bool>("switch", true);
359  psd14.add<double>("xmax", 100.0);
360  psd14.add<int>("NxBins", 100);
361  desc.add<edm::ParameterSetDescription>("DeltaX_primary", psd14);
362 
364  psd15.add<std::string>("name", "Delta_Y_SimHitPrimary");
365  psd15.add<std::string>("title", "Delta_Y_SimHitPrimary;#Delta y [#mum];");
366  psd15.add<double>("xmin", -100.0);
367  psd15.add<bool>("switch", true);
368  psd15.add<double>("xmax", 100.0);
369  psd15.add<int>("NxBins", 100);
370  desc.add<edm::ParameterSetDescription>("DeltaY_primary", psd15);
371 
373  psd16.add<std::string>("name", "Pull_X_SimHitPrimary");
374  psd16.add<std::string>("title", "Pull_X_SimHitPrimary;pull x;");
375  psd16.add<double>("ymax", 4.0);
376  psd16.add<int>("NxBins", 82);
377  psd16.add<bool>("switch", true);
378  psd16.add<double>("xmax", 4.1);
379  psd16.add<double>("xmin", -4.1);
380  psd16.add<double>("ymin", -4.0);
381  desc.add<edm::ParameterSetDescription>("PullX_primary", psd16);
382 
384  psd17.add<std::string>("name", "Pull_Y_SimHitPrimary");
385  psd17.add<std::string>("title", "Pull_Y_SimHitPrimary;pull y;");
386  psd17.add<double>("ymax", 4.0);
387  psd17.add<int>("NxBins", 82);
388  psd17.add<bool>("switch", true);
389  psd17.add<double>("xmax", 4.1);
390  psd17.add<double>("xmin", -4.1);
391  psd17.add<double>("ymin", -4.0);
392  desc.add<edm::ParameterSetDescription>("PullY_primary", psd17);
393 }
ParameterDescriptionBase * add(U const &iLabel, T const &value)
#define M_PI

◆ fillRechitHistos()

void Phase2ITValidateRecHitBase::fillRechitHistos ( const PSimHit simhitClosest,
const SiPixelRecHit rechit,
const std::map< unsigned int, SimTrack > &  selectedSimTrackMap,
std::map< std::string, unsigned int > &  nrechitLayerMap_primary 
)
protected

Definition at line 123 of file Phase2ITValidateRecHitBase.cc.

References funct::abs(), SiPixelRecHit::cluster(), phase2tkutil::cmtomicron, PVValHelper::dx, PVValHelper::dy, PVValHelper::eta, TrackingRecHit::geographicalId(), phase2tkutil::getITHistoId(), TrackerGeometry::idToDetUnit(), phase2tkutil::isPrimary(), crabWrapper::key, layerMEs_, PSimHit::localPosition(), BaseTrackerRecHit::localPosition(), BaseTrackerRecHit::localPositionError(), phi, nano_mu_digi_cff::rawId, mathSSE::sqrt(), AlCaHLTBitMon_QueryRunRegistry::string, tkGeom_, PSimHit::trackId(), tTopo_, PV3DBase< T, PVType, FrameType >::x(), and PV3DBase< T, PVType, FrameType >::y().

Referenced by Phase2ITValidateRecHit::fillITHistos(), and Phase2ITValidateTrackingRecHit::fillITHistos().

126  {
127  auto id = rechit->geographicalId();
129  const GeomDetUnit* geomDetunit(tkGeom_->idToDetUnit(id));
130  if (!geomDetunit)
131  return;
132 
133  LocalPoint lp = rechit->localPosition();
134  auto simTrackIt(selectedSimTrackMap.find(simhitClosest->trackId()));
135  bool isPrimary = false;
136  //check if simhit is primary
137  if (simTrackIt != selectedSimTrackMap.end())
138  isPrimary = phase2tkutil::isPrimary(simTrackIt->second, simhitClosest);
139 
140  Local3DPoint simlp(simhitClosest->localPosition());
141  const LocalError& lperr = rechit->localPositionError();
142  double dx = phase2tkutil::cmtomicron * (lp.x() - simlp.x());
143  double dy = phase2tkutil::cmtomicron * (lp.y() - simlp.y());
144  double pullx = 999.;
145  double pully = 999.;
146  if (lperr.xx())
147  pullx = (lp.x() - simlp.x()) / std::sqrt(lperr.xx());
148  if (lperr.yy())
149  pully = (lp.y() - simlp.y()) / std::sqrt(lperr.yy());
150  float eta = geomDetunit->surface().toGlobal(lp).eta();
151  float phi = geomDetunit->surface().toGlobal(lp).phi();
152  layerMEs_[key].deltaX->Fill(dx);
153  layerMEs_[key].deltaY->Fill(dy);
154  layerMEs_[key].pullX->Fill(pullx);
155  layerMEs_[key].pullY->Fill(pully);
156 
157  layerMEs_[key].deltaX_eta->Fill(std::abs(eta), dx);
158  layerMEs_[key].deltaY_eta->Fill(std::abs(eta), dy);
159  layerMEs_[key].deltaX_phi->Fill(phi, dx);
160  layerMEs_[key].deltaY_phi->Fill(phi, dy);
161 
162  layerMEs_[key].deltaX_clsizex->Fill(rechit->cluster()->sizeX(), dx);
163  layerMEs_[key].deltaX_clsizey->Fill(rechit->cluster()->sizeY(), dx);
164  layerMEs_[key].deltaY_clsizex->Fill(rechit->cluster()->sizeX(), dy);
165  layerMEs_[key].deltaY_clsizey->Fill(rechit->cluster()->sizeY(), dy);
166  layerMEs_[key].deltaYvsdeltaX->Fill(dx, dy);
167  layerMEs_[key].pullX_eta->Fill(eta, pullx);
168  layerMEs_[key].pullY_eta->Fill(eta, pully);
169  if (isPrimary) {
170  layerMEs_[key].deltaX_primary->Fill(dx);
171  layerMEs_[key].deltaY_primary->Fill(dy);
172  layerMEs_[key].pullX_primary->Fill(pullx);
173  layerMEs_[key].pullY_primary->Fill(pully);
174  } else {
175  nrechitLayerMap_primary[key]--;
176  }
177 }
ClusterRef cluster() const
Definition: SiPixelRecHit.h:47
std::map< std::string, RecHitME > layerMEs_
const TrackerGeomDet * idToDetUnit(DetId) const override
Return the pointer to the GeomDetUnit corresponding to a given DetId.
static constexpr float cmtomicron
bool isPrimary(const SimTrack &simTrk, const PSimHit *simHit)
std::string getITHistoId(uint32_t det_id, const TrackerTopology *tTopo)
T x() const
Definition: PV3DBase.h:59
T y() const
Definition: PV3DBase.h:60
T sqrt(T t)
Definition: SSEVec.h:19
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
unsigned int trackId() const
Definition: PSimHit.h:106
LocalError localPositionError() const override
DetId geographicalId() const
Local3DPoint localPosition() const
Definition: PSimHit.h:52
LocalPoint localPosition() const override

Member Data Documentation

◆ config_

edm::ParameterSet Phase2ITValidateRecHitBase::config_
protected

Definition at line 56 of file Phase2ITValidateRecHitBase.h.

Referenced by bookHistograms(), and bookLayerHistos().

◆ geomToken_

const edm::ESGetToken<TrackerGeometry, TrackerDigiGeometryRecord> Phase2ITValidateRecHitBase::geomToken_
protected

Definition at line 57 of file Phase2ITValidateRecHitBase.h.

Referenced by dqmBeginRun().

◆ layerMEs_

std::map<std::string, RecHitME> Phase2ITValidateRecHitBase::layerMEs_
protected

◆ tkGeom_

const TrackerGeometry* Phase2ITValidateRecHitBase::tkGeom_ = nullptr
protected

◆ topoToken_

const edm::ESGetToken<TrackerTopology, TrackerTopologyRcd> Phase2ITValidateRecHitBase::topoToken_
protected

Definition at line 58 of file Phase2ITValidateRecHitBase.h.

Referenced by dqmBeginRun().

◆ tTopo_

const TrackerTopology* Phase2ITValidateRecHitBase::tTopo_ = nullptr
protected