CMS 3D CMS Logo

List of all members | Classes | Public Member Functions | Private Types | Private Member Functions | Private Attributes
MonitorTrackResidualsBase< pixel_or_strip > Class Template Reference

#include <MonitorTrackResiduals.h>

Inheritance diagram for MonitorTrackResidualsBase< pixel_or_strip >:
DQMEDAnalyzer edm::one::EDProducer< edm::Accumulator, edm::EndLuminosityBlockProducer, edm::EndRunProducer, edm::one::WatchLuminosityBlocks, edm::one::WatchRuns > edm::one::EDProducerBase edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Classes

struct  HistoPair
 
struct  HistoXY
 

Public Member Functions

void analyze (const edm::Event &, const edm::EventSetup &) override
 
void bookHistograms (DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
 
void dqmBeginRun (const edm::Run &, const edm::EventSetup &) override
 
 MonitorTrackResidualsBase (const edm::ParameterSet &)
 
 ~MonitorTrackResidualsBase () override
 
- Public Member Functions inherited from DQMEDAnalyzer
void accumulate (edm::Event const &ev, edm::EventSetup const &es) final
 
virtual void analyze (edm::Event const &, edm::EventSetup const &)
 
void beginLuminosityBlock (edm::LuminosityBlock const &lumi, edm::EventSetup const &setup) override
 
void beginRun (edm::Run const &run, edm::EventSetup const &setup) final
 
virtual void dqmBeginRun (edm::Run const &, edm::EventSetup const &)
 
 DQMEDAnalyzer ()
 
 DQMEDAnalyzer (DQMEDAnalyzer const &)=delete
 
 DQMEDAnalyzer (DQMEDAnalyzer &&)=delete
 
void endLuminosityBlock (edm::LuminosityBlock const &, edm::EventSetup const &) override
 
void endLuminosityBlockProduce (edm::LuminosityBlock &lumi, edm::EventSetup const &setup) final
 
void endRun (edm::Run const &run, edm::EventSetup const &setup) override
 
void endRunProduce (edm::Run &run, edm::EventSetup const &setup) override
 
 ~DQMEDAnalyzer () override=default
 
- Public Member Functions inherited from edm::one::EDProducer< edm::Accumulator, edm::EndLuminosityBlockProducer, edm::EndRunProducer, edm::one::WatchLuminosityBlocks, edm::one::WatchRuns >
 EDProducer ()=default
 
SerialTaskQueueglobalLuminosityBlocksQueue () final
 
SerialTaskQueueglobalRunsQueue () final
 
bool hasAbilityToProduceInLumis () const final
 
bool hasAbilityToProduceInRuns () const final
 
bool wantsGlobalLuminosityBlocks () const final
 
bool wantsGlobalRuns () const final
 
- Public Member Functions inherited from edm::one::EDProducerBase
 EDProducerBase ()
 
ModuleDescription const & moduleDescription () const
 
bool wantsStreamLuminosityBlocks () const
 
bool wantsStreamRuns () const
 
 ~EDProducerBase () override
 
- Public Member Functions inherited from edm::ProducerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
std::vector< edm::ProductResolverIndex > const & indiciesForPutProducts (BranchType iBranchType) const
 
 ProducerBase ()
 
std::vector< edm::ProductResolverIndex > const & putTokenIndexToProductResolverIndex () const
 
void registerProducts (ProducerBase *, ProductRegistry *, ModuleDescription const &)
 
std::function< void(BranchDescription const &)> registrationCallback () const
 used by the fwk to register list of products More...
 
void resolvePutIndicies (BranchType iBranchType, ModuleToResolverIndicies const &iIndicies, std::string const &moduleLabel)
 
 ~ProducerBase () noexcept(false) override
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
void convertCurrentProcessAlias (std::string const &processName)
 Convert "@currentProcess" in InputTag process names to the actual current process name. More...
 
 EDConsumerBase ()
 
 EDConsumerBase (EDConsumerBase const &)=delete
 
 EDConsumerBase (EDConsumerBase &&)=default
 
ProductResolverIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
std::vector< ProductResolverIndexAndSkipBit > const & itemsToGetFrom (BranchType iType) const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesWhoseProductsAreConsumed (std::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
bool registeredToConsume (ProductResolverIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
ProductResolverIndexAndSkipBit uncheckedIndexFrom (EDGetToken) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
virtual ~EDConsumerBase () noexcept(false)
 

Private Types

typedef std::map< std::pair< std::string, int32_t >, HistoXYHistoSet
 

Private Member Functions

void createMEs (DQMStore::IBooker &, const edm::EventSetup &)
 
std::pair< std::string, int32_t > findSubdetAndLayer (uint32_t ModuleID, const TrackerTopology *tTopo)
 

Private Attributes

TrackerValidationVariables avalidator_
 
edm::ParameterSet conf_
 
GenericTriggerEventFlaggenTriggerEventFlag_
 
unsigned long long m_cacheID_
 
HistoSet m_ModuleResiduals
 
HistoSet m_SubdetLayerResiduals
 
bool ModOn
 
edm::EDGetTokenT< reco::VertexCollectionofflinePrimaryVerticesToken_
 
edm::ParameterSet Parameters
 
std::unique_ptr< TkHistoMaptkhisto_ResidualsMean
 

Additional Inherited Members

- Public Types inherited from edm::one::EDProducerBase
typedef EDProducerBase ModuleType
 
- Public Types inherited from edm::ProducerBase
using ModuleToResolverIndicies = std::unordered_multimap< std::string, std::tuple< edm::TypeID const *, const char *, edm::ProductResolverIndex >>
 
typedef ProductRegistryHelper::TypeLabelList TypeLabelList
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- Static Public Member Functions inherited from edm::one::EDProducerBase
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 
- Protected Member Functions inherited from edm::EDConsumerBase
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken consumes (TypeToGet const &id, edm::InputTag const &tag)
 
ConsumesCollector consumesCollector ()
 Use a ConsumesCollector to gather consumes information from helper functions. More...
 
template<typename ProductType , BranchType B = InEvent>
void consumesMany ()
 
void consumesMany (const TypeToGet &id)
 
template<BranchType B>
void consumesMany (const TypeToGet &id)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
- Protected Attributes inherited from DQMEDAnalyzer
edm::EDPutTokenT< DQMTokenlumiToken_
 
edm::EDPutTokenT< DQMTokenrunToken_
 

Detailed Description

template<TrackerType pixel_or_strip>
class MonitorTrackResidualsBase< pixel_or_strip >

Definition at line 38 of file MonitorTrackResiduals.h.

Member Typedef Documentation

template<TrackerType pixel_or_strip>
typedef std::map<std::pair<std::string, int32_t>, HistoXY> MonitorTrackResidualsBase< pixel_or_strip >::HistoSet
private

Definition at line 61 of file MonitorTrackResiduals.h.

Constructor & Destructor Documentation

template<TrackerType pixel_or_strip>
MonitorTrackResidualsBase< pixel_or_strip >::MonitorTrackResidualsBase ( const edm::ParameterSet iConfig)
explicit

Definition at line 20 of file MonitorTrackResiduals.cc.

References MonitorTrackResidualsBase< pixel_or_strip >::conf_, edm::ParameterSet::getParameter(), MonitorTrackResidualsBase< pixel_or_strip >::ModOn, MonitorTrackResidualsBase< pixel_or_strip >::offlinePrimaryVerticesToken_, and AlCaHLTBitMon_QueryRunRegistry::string.

21  : conf_(iConfig), m_cacheID_(0)
22  , genTriggerEventFlag_(new GenericTriggerEventFlag(iConfig.getParameter<edm::ParameterSet>("genericTriggerEventPSet"), consumesCollector(), *this))
23  , avalidator_(iConfig, consumesCollector()) {
24  ModOn = conf_.getParameter<bool>("Mod_On");
25  offlinePrimaryVerticesToken_ = consumes<reco::VertexCollection>(std::string("offlinePrimaryVertices"));
26 }
T getParameter(std::string const &) const
TrackerValidationVariables avalidator_
Provides a code based selection for trigger and DCS information in order to have no failing filters i...
edm::EDGetTokenT< reco::VertexCollection > offlinePrimaryVerticesToken_
ConsumesCollector consumesCollector()
Use a ConsumesCollector to gather consumes information from helper functions.
GenericTriggerEventFlag * genTriggerEventFlag_
template<TrackerType pixel_or_strip>
MonitorTrackResidualsBase< pixel_or_strip >::~MonitorTrackResidualsBase ( )
override

Member Function Documentation

template<TrackerType pixel_or_strip>
void MonitorTrackResidualsBase< pixel_or_strip >::analyze ( const edm::Event iEvent,
const edm::EventSetup iSetup 
)
override

Definition at line 222 of file MonitorTrackResiduals.cc.

References funct::abs(), GenericTriggerEventFlag::accept(), MonitorTrackResidualsBase< pixel_or_strip >::avalidator_, DEFINE_FWK_MODULE, reco::TrackBase::dxy(), reco::TrackBase::dxyError(), TrackerValidationVariables::fillTrackQuantities(), MonitorTrackResidualsBase< pixel_or_strip >::findSubdetAndLayer(), MonitorTrackResidualsBase< pixel_or_strip >::genTriggerEventFlag_, edm::EventSetup::get(), edm::Event::getByToken(), plotFactory::histos, fastTrackerRecHitType::isPixel(), edm::HandleBase::isValid(), MonitorTrackResidualsBase< pixel_or_strip >::m_ModuleResiduals, MonitorTrackResidualsBase< pixel_or_strip >::m_SubdetLayerResiduals, MonitorTrackResidualsBase< pixel_or_strip >::ModOn, MonitorTrackResidualsBase< pixel_or_strip >::offlinePrimaryVerticesToken_, GenericTriggerEventFlag::on(), impactParameterTagInfos_cfi::primaryVertex, edm::ESHandle< T >::product(), reco::TrackBase::pt(), MonitorTrackResidualsBase< pixel_or_strip >::tkhisto_ResidualsMean, HiIsolationCommonParameters_cff::track, TRACKERTYPE_PIXEL, parallelization::uint(), and electrons_cff::vertices.

222  {
223 
224  auto vtracks = std::vector<TrackerValidationVariables::AVTrackStruct>();
225  // Filter out events if Trigger Filtering is requested
226  if (genTriggerEventFlag_->on()&& ! genTriggerEventFlag_->accept( iEvent, iSetup) ) return;
227 
229  iEvent.getByToken(offlinePrimaryVerticesToken_, vertices);
230  if (!vertices.isValid() || vertices->empty()) return;
231  const auto primaryVertex = vertices->at(0);
232 
233  //Retrieve tracker topology from geometry
234  edm::ESHandle<TrackerTopology> tTopoHandle;
235  iSetup.get<TrackerTopologyRcd>().get(tTopoHandle);
236  const TrackerTopology* const tTopo = tTopoHandle.product();
237 
238  avalidator_.fillTrackQuantities(iEvent, iSetup,
239  // tell the validator to only look at good tracks
240  [&](const reco::Track& track) -> bool {
241  return track.pt() > 0.75
242  && abs( track.dxy(primaryVertex.position()) ) < 5*track.dxyError();
243  }, vtracks);
244 
245  for (auto& track : vtracks) {
246  for (auto& it : track.hits) {
247  uint RawId = it.rawDetId;
248 
249  auto id = DetId(RawId);
250  auto isPixel = id.subdetId() == 1 || id.subdetId() == 2;
251  if (isPixel != (pixel_or_strip == TRACKERTYPE_PIXEL)) continue;
252 
253 
254  if (ModOn) {
255  auto& mod_histos = m_ModuleResiduals[std::make_pair("",RawId)];
256  mod_histos.x.base->Fill(it.resXprime);
257  mod_histos.x.normed->Fill(it.resXprime/it.resXprimeErr);
258  mod_histos.y.base->Fill(it.resYprime);
259  mod_histos.y.normed->Fill(it.resYprime/it.resYprimeErr);
260  }
261 
262  auto subdetandlayer = findSubdetAndLayer(RawId, tTopo);
263  auto histos = m_SubdetLayerResiduals[subdetandlayer];
264  // fill if its error is not zero
265  if(it.resXprimeErr != 0 && histos.x.base) {
266  histos.x.base->Fill(it.resXprime);
267  histos.x.normed->Fill(it.resXprime/it.resXprimeErr);
268  if(!isPixel) tkhisto_ResidualsMean->fill(RawId,it.resXprime);
269  }
270  if(it.resYprimeErr != 0 && histos.y.base) {
271  histos.y.base->Fill(it.resYprime);
272  histos.y.normed->Fill(it.resYprime/it.resYprimeErr);
273  }
274  }
275  }
276 }
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:579
double dxyError() const
error on dxy
Definition: TrackBase.h:796
TrackerValidationVariables avalidator_
edm::EDGetTokenT< reco::VertexCollection > offlinePrimaryVerticesToken_
std::unique_ptr< TkHistoMap > tkhisto_ResidualsMean
bool accept(const edm::Event &event, const edm::EventSetup &setup)
To be called from analyze/filter() methods.
double pt() const
track transverse momentum
Definition: TrackBase.h:621
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
bool isValid() const
Definition: HandleBase.h:74
Definition: DetId.h:18
void fillTrackQuantities(const edm::Event &, const edm::EventSetup &, std::vector< AVTrackStruct > &v_avtrackout)
GenericTriggerEventFlag * genTriggerEventFlag_
def uint(string)
T get() const
Definition: EventSetup.h:63
bool isPixel(HitType hitType)
double dxy() const
dxy parameter. (This is the transverse impact parameter w.r.t. to (0,0,0) ONLY if refPoint is close t...
Definition: TrackBase.h:591
std::pair< std::string, int32_t > findSubdetAndLayer(uint32_t ModuleID, const TrackerTopology *tTopo)
T const * product() const
Definition: ESHandle.h:86
template<TrackerType pixel_or_strip>
void MonitorTrackResidualsBase< pixel_or_strip >::bookHistograms ( DQMStore::IBooker ,
edm::Run const &  ,
edm::EventSetup const &   
)
overridevirtual

Implements DQMEDAnalyzer.

Definition at line 34 of file MonitorTrackResiduals.cc.

References MonitorTrackResidualsBase< pixel_or_strip >::createMEs(), edm::EventSetup::get(), MonitorTrackResidualsBase< pixel_or_strip >::m_cacheID_, edm::ESHandle< T >::product(), SiStripFolderOrganizer::setSiStripFolderName(), AlCaHLTBitMon_QueryRunRegistry::string, and MonitorTrackResidualsBase< pixel_or_strip >::tkhisto_ResidualsMean.

35 {
36  unsigned long long cacheID = iSetup.get<TrackerDigiGeometryRecord>().cacheIdentifier();
37  if (m_cacheID_ != cacheID) {
38  m_cacheID_ = cacheID;
39  this->createMEs( ibooker , iSetup);
40  }
41  std::string topFolderName_ = "SiStrip";
42  SiStripFolderOrganizer folder_organizer;
43  folder_organizer.setSiStripFolderName(topFolderName_);
44  edm::ESHandle<TkDetMap> tkDetMapHandle;
45  iSetup.get<TrackerTopologyRcd>().get(tkDetMapHandle);
46  tkhisto_ResidualsMean = std::make_unique<TkHistoMap>(tkDetMapHandle.product(), ibooker , topFolderName_ ,"TkHMap_ResidualsMean", 0.0,true);
47 }
void setSiStripFolderName(std::string name)
std::unique_ptr< TkHistoMap > tkhisto_ResidualsMean
void createMEs(DQMStore::IBooker &, const edm::EventSetup &)
T const * product() const
Definition: ESHandle.h:86
template<TrackerType pixel_or_strip>
void MonitorTrackResidualsBase< pixel_or_strip >::createMEs ( DQMStore::IBooker ibooker,
const edm::EventSetup iSetup 
)
private

Definition at line 98 of file MonitorTrackResiduals.cc.

References funct::abs(), DQMStore::IBooker::book1D(), MonitorTrackResidualsBase< pixel_or_strip >::conf_, TrackerGeometry::detIds(), MonitorTrackResidualsBase< pixel_or_strip >::findSubdetAndLayer(), edm::EventSetup::get(), edm::ParameterSet::getParameter(), plotFactory::histos, gedGsfElectrons_cfi::isBarrel, fastTrackerRecHitType::isPixel(), MonitorTrackResidualsBase< pixel_or_strip >::m_ModuleResiduals, MonitorTrackResidualsBase< pixel_or_strip >::m_SubdetLayerResiduals, MonitorTrackResidualsBase< pixel_or_strip >::ModOn, edm::ESHandle< T >::product(), MonitorElement::setAxisTitle(), DQMStore::IBooker::setCurrentFolder(), SiStripFolderOrganizer::setDetectorFolder(), SiStripFolderOrganizer::setLayerFolder(), AlCaHLTBitMon_QueryRunRegistry::string, TRACKERTYPE_PIXEL, and geometryCSVtoXML::xy.

Referenced by MonitorTrackResidualsBase< pixel_or_strip >::bookHistograms().

98  {
99 
100  //Retrieve tracker topology and geometry
101  edm::ESHandle<TrackerTopology> tTopoHandle;
102  iSetup.get<TrackerTopologyRcd>().get(tTopoHandle);
103  const TrackerTopology* const tTopo = tTopoHandle.product();
104 
106  iSetup.get<TrackerDigiGeometryRecord>().get(TG);
107 
108  Parameters = conf_.getParameter<edm::ParameterSet>("TH1ResModules");
109  int32_t i_residuals_Nbins = Parameters.getParameter<int32_t>("Nbinx");
110  double d_residual_xmin = Parameters.getParameter<double>("xmin");
111  double d_residual_xmax = Parameters.getParameter<double>("xmax");
112  Parameters = conf_.getParameter<edm::ParameterSet>("TH1NormResModules");
113  int32_t i_normres_Nbins = Parameters.getParameter<int32_t>("Nbinx");
114  double d_normres_xmin = Parameters.getParameter<double>("xmin");
115  double d_normres_xmax = Parameters.getParameter<double>("xmax");
116 
117 
118  // use SistripHistoId for producing histogram id (and title)
119  SiStripHistoId hidmanager;
120 
121  SiStripFolderOrganizer strip_organizer;
122  auto pixel_organizer = SiPixelFolderOrganizer(false);
123 
124  // Collect list of modules from Tracker Geometry
125  // book histo per each detector module
126  auto ids = TG->detIds(); // or detUnitIds?
127  for (DetId id : ids)
128  {
129  auto ModuleID = id.rawId();
130  auto isPixel = id.subdetId() == 1 || id.subdetId() == 2;
131  if (isPixel != (pixel_or_strip == TRACKERTYPE_PIXEL)) continue;
132 
133  // Book module histogramms?
134  if (ModOn) {
135  switch (id.subdetId()) {
136  case 1: pixel_organizer.setModuleFolder(ibooker, ModuleID, 0); break;
137  case 2: pixel_organizer.setModuleFolder(ibooker, ModuleID, 0); break;
138  default: strip_organizer.setDetectorFolder(ModuleID,tTopo);
139  }
140  {
141  // this sounds strip specific but also works for pixel
142  std::string hid = hidmanager.createHistoId("HitResidualsX","det",ModuleID);
143  std::string normhid = hidmanager.createHistoId("NormalizedHitResidualsX","det",ModuleID);
144  auto& histos = m_ModuleResiduals[std::make_pair("", ModuleID)];
145  histos.x.base = ibooker.book1D(hid, hid, i_residuals_Nbins,d_residual_xmin,d_residual_xmax);
146  histos.x.base->setAxisTitle("(x_{pred} - x_{rec})' [cm]");
147  histos.x.normed = ibooker.book1D(normhid, normhid, i_normres_Nbins,d_normres_xmin,d_normres_xmax);
148  histos.x.normed->setAxisTitle("(x_{pred} - x_{rec})'/#sigma");
149  }{
150  std::string hid = hidmanager.createHistoId("HitResidualsY","det",ModuleID);
151  std::string normhid = hidmanager.createHistoId("NormalizedHitResidualsY","det",ModuleID);
152  auto& histos = m_ModuleResiduals[std::make_pair("", ModuleID)];
153  histos.y.base = ibooker.book1D(hid, hid, i_residuals_Nbins,d_residual_xmin,d_residual_xmax);
154  histos.y.base->setAxisTitle("(y_{pred} - y_{rec})' [cm]");
155  histos.y.normed = ibooker.book1D(normhid, normhid, i_normres_Nbins,d_normres_xmin,d_normres_xmax);
156  histos.y.normed->setAxisTitle("(y_{pred} - y_{rec})'/#sigma");
157  }
158  }
159 
160  auto subdetandlayer = findSubdetAndLayer(ModuleID, tTopo);
161  if(m_SubdetLayerResiduals.find(subdetandlayer) == m_SubdetLayerResiduals.end()) {
162  // add new histograms
163  auto& histos = m_SubdetLayerResiduals[subdetandlayer];
164  switch (id.subdetId()) {
165  // Pixel Barrel, Endcap
166  // We can't use the folder organizer here (SiPixelActionExecutor.cc#1638 does the same)
167  case 1: ibooker.setCurrentFolder("Pixel/Barrel"); break;
168  case 2: ibooker.setCurrentFolder("Pixel/Endcap"); break;
169  // All strip
170  default: strip_organizer.setLayerFolder(ModuleID,tTopo,subdetandlayer.second);
171  }
172 
173  auto isBarrel = subdetandlayer.first.find("B") != std::string::npos;
174 
175  auto xy = std::vector<std::pair<HistoPair&, const char*> >
176  { std::make_pair(std::ref(histos.x), "X"),
177  std::make_pair(std::ref(histos.y), "Y") };
178  for (auto& histopair : xy) {
179  // book histogramms on layer level, check for barrel/pixel only for correct labeling
180 
181  // Skip the Y plots for strips.
182  if (!isPixel && histopair.second[0] == 'Y') continue;
183 
184  std::string histoname = isPixel ? ( // Pixel name
185  Form("HitResiduals%s_%s%d",
186  histopair.second,
187  isBarrel ? "L" : (subdetandlayer.second > 0 ? "Dp" : "Dm"),
188  std::abs(subdetandlayer.second)))
189  : (Form("HitResiduals_%s__%s__%d", // Strip TODO: We use a legacy name.
190  subdetandlayer.first.c_str(),
191  isBarrel ? "Layer" : "wheel",
192  std::abs(subdetandlayer.second)));
193 
194  std::string histotitle = Form("HitResiduals %s on %s%s full %s %d",
195  histopair.second,
196  subdetandlayer.first.c_str(),
197  isBarrel ? "" : (subdetandlayer.second > 0 ? "+" : "-"),
198  isBarrel ? "Layer" : (isPixel ? "Disk" : "Wheel"),
199  std::abs(subdetandlayer.second));
200 
201 
202  std::string normhistoname = Form("Normalized%s", histoname.c_str());
203  std::string normhistotitle = Form("Normalized%s", histotitle.c_str());
204 
205  //std::cout << "##### Booking: " << ibooker.pwd() << " title " << histoname << std::endl;
206 
207  histopair.first.base =
208  ibooker.book1D(histoname.c_str(),histotitle.c_str(),
209  i_residuals_Nbins,d_residual_xmin,d_residual_xmax);
210  histopair.first.base->setAxisTitle("(x_{pred} - x_{rec})' [cm]");
211 
212  histopair.first.normed =
213  ibooker.book1D(normhistoname.c_str(),normhistotitle.c_str(),
214  i_normres_Nbins,d_normres_xmin,d_normres_xmax);
215  histopair.first.normed->setAxisTitle("(x_{pred} - x_{rec})'/#sigma");
216  }
217  }
218  } // end loop over activeDets
219 }
T getParameter(std::string const &) const
void setLayerFolder(uint32_t rawdetid, const TrackerTopology *tTopo, int32_t layer=0, bool ring_flag=false)
void setDetectorFolder(uint32_t rawdetid, const TrackerTopology *tTopo)
vector< ParameterSet > Parameters
MonitorElement * book1D(Args &&...args)
Definition: DQMStore.h:118
const DetIdContainer & detIds() const override
Returm a vector of all GeomDet DetIds (including those of GeomDetUnits)
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
Definition: DetId.h:18
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:274
T get() const
Definition: EventSetup.h:63
bool isPixel(HitType hitType)
std::pair< std::string, int32_t > findSubdetAndLayer(uint32_t ModuleID, const TrackerTopology *tTopo)
void setAxisTitle(const std::string &title, int axis=1)
set x-, y- or z-axis title (axis=1, 2, 3 respectively)
T const * product() const
Definition: ESHandle.h:86
template<TrackerType pixel_or_strip>
void MonitorTrackResidualsBase< pixel_or_strip >::dqmBeginRun ( const edm::Run ,
const edm::EventSetup  
)
override

Definition at line 50 of file MonitorTrackResiduals.cc.

References MonitorTrackResidualsBase< pixel_or_strip >::genTriggerEventFlag_, GenericTriggerEventFlag::initRun(), and GenericTriggerEventFlag::on().

50  {
51 
52  // Initialize the GenericTriggerEventFlag
54 }
GenericTriggerEventFlag * genTriggerEventFlag_
void initRun(const edm::Run &run, const edm::EventSetup &setup)
To be called from beginRun() methods.
template<TrackerType pixel_or_strip>
std::pair< std::string, int32_t > MonitorTrackResidualsBase< pixel_or_strip >::findSubdetAndLayer ( uint32_t  ModuleID,
const TrackerTopology tTopo 
)
private

Definition at line 57 of file MonitorTrackResiduals.cc.

References TrackerTopology::pxbLayer(), TrackerTopology::pxfDisk(), TrackerTopology::pxfSide(), AlCaHLTBitMon_QueryRunRegistry::string, TrackerTopology::tecSide(), TrackerTopology::tecWheel(), TrackerTopology::tibLayer(), TrackerTopology::tidSide(), TrackerTopology::tidWheel(), and TrackerTopology::tobLayer().

Referenced by MonitorTrackResidualsBase< pixel_or_strip >::analyze(), and MonitorTrackResidualsBase< pixel_or_strip >::createMEs().

57  {
58  std::string subdet = "";
59  int32_t layer = 0;
60  auto id = DetId(ModuleID);
61  switch (id.subdetId()) {
62  // Pixel Barrel, Endcap
63  case 1:
64  subdet = "BPIX";
65  layer = tTopo->pxbLayer(id);
66  break;
67  case 2:
68  subdet = "FPIX";
69  layer = tTopo->pxfDisk(id) * ( tTopo->pxfSide(ModuleID)==1 ? -1 : +1);
70  break;
71  // Strip TIB, TID, TOB, TEC
72  case 3:
73  subdet = "TIB";
74  layer = tTopo->tibLayer(id);
75  break;
76  case 4:
77  subdet = "TID";
78  layer = tTopo->tidWheel(id) * ( tTopo->tidSide(ModuleID)==1 ? -1 : +1);
79  break;
80  case 5:
81  subdet = "TOB";
82  layer = tTopo->tobLayer(id);
83  break;
84  case 6:
85  subdet = "TEC";
86  layer = tTopo->tecWheel(id) * ( tTopo->tecSide(ModuleID)==1 ? -1 : +1);
87  break;
88  default:
89  // TODO: Fail loudly.
90  subdet = "UNKNOWN";
91  layer = 0;
92  }
93  return std::make_pair(subdet, layer);
94 }
unsigned int tibLayer(const DetId &id) const
unsigned int pxfDisk(const DetId &id) const
unsigned int tidWheel(const DetId &id) const
unsigned int tidSide(const DetId &id) const
unsigned int pxbLayer(const DetId &id) const
Definition: DetId.h:18
unsigned int pxfSide(const DetId &id) const
unsigned int tecWheel(const DetId &id) const
unsigned int tobLayer(const DetId &id) const
unsigned int tecSide(const DetId &id) const

Member Data Documentation

template<TrackerType pixel_or_strip>
TrackerValidationVariables MonitorTrackResidualsBase< pixel_or_strip >::avalidator_
private
template<TrackerType pixel_or_strip>
edm::ParameterSet MonitorTrackResidualsBase< pixel_or_strip >::conf_
private
template<TrackerType pixel_or_strip>
GenericTriggerEventFlag* MonitorTrackResidualsBase< pixel_or_strip >::genTriggerEventFlag_
private
template<TrackerType pixel_or_strip>
unsigned long long MonitorTrackResidualsBase< pixel_or_strip >::m_cacheID_
private
template<TrackerType pixel_or_strip>
HistoSet MonitorTrackResidualsBase< pixel_or_strip >::m_ModuleResiduals
private
template<TrackerType pixel_or_strip>
HistoSet MonitorTrackResidualsBase< pixel_or_strip >::m_SubdetLayerResiduals
private
template<TrackerType pixel_or_strip>
bool MonitorTrackResidualsBase< pixel_or_strip >::ModOn
private
template<TrackerType pixel_or_strip>
edm::EDGetTokenT<reco::VertexCollection> MonitorTrackResidualsBase< pixel_or_strip >::offlinePrimaryVerticesToken_
private
template<TrackerType pixel_or_strip>
edm::ParameterSet MonitorTrackResidualsBase< pixel_or_strip >::Parameters
private

Definition at line 68 of file MonitorTrackResiduals.h.

template<TrackerType pixel_or_strip>
std::unique_ptr<TkHistoMap> MonitorTrackResidualsBase< pixel_or_strip >::tkhisto_ResidualsMean
private