CMS 3D CMS Logo

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

#include <TkAlCaRecoMonitor.h>

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

Public Member Functions

void analyze (const edm::Event &, const edm::EventSetup &) override
 
void bookHistograms (DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
 
 TkAlCaRecoMonitor (const edm::ParameterSet &)
 
 ~TkAlCaRecoMonitor () 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
 
virtual void dqmBeginLuminosityBlock (edm::LuminosityBlock const &, edm::EventSetup const &)
 
virtual void dqmBeginRun (edm::Run const &, edm::EventSetup const &)
 
 DQMEDAnalyzer ()
 
virtual void dqmEndLuminosityBlock (edm::LuminosityBlock const &, edm::EventSetup const &)
 
virtual void dqmEndRun (edm::Run const &, edm::EventSetup const &)
 
void endLuminosityBlock (edm::LuminosityBlock const &, edm::EventSetup const &) final
 
void endLuminosityBlockProduce (edm::LuminosityBlock &lumi, edm::EventSetup const &setup) final
 
void endRun (edm::Run const &, edm::EventSetup const &) final
 
void endRunProduce (edm::Run &run, edm::EventSetup const &setup) final
 
virtual bool getCanSaveByLumi ()
 
- Public Member Functions inherited from edm::one::EDProducer< edm::EndRunProducer, edm::one::WatchRuns, edm::EndLuminosityBlockProducer, edm::one::WatchLuminosityBlocks, edm::Accumulator >
 EDProducer ()=default
 
SerialTaskQueueglobalLuminosityBlocksQueue () final
 
SerialTaskQueueglobalRunsQueue () final
 
bool hasAbilityToProduceInBeginLumis () const final
 
bool hasAbilityToProduceInBeginRuns () const final
 
bool hasAbilityToProduceInEndLumis () const final
 
bool hasAbilityToProduceInEndRuns () 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
 
ESProxyIndex const * esGetTokenIndices (edm::Transition iTrans) const
 
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)
 
void updateLookup (eventsetup::ESRecordsToProxyIndices const &)
 
virtual ~EDConsumerBase () noexcept(false)
 

Private Member Functions

void fillHitmaps (const reco::Track &track, const TrackerGeometry &geometry)
 
void fillRawIdMap (const TrackerGeometry &geometry)
 

Private Attributes

MonitorElementAlCaRecoTrackEfficiency_
 
std::map< int, int > binByRawId_
 
edm::ParameterSet conf_
 
double daughterMass_
 
bool fillInvariantMass_
 
bool fillRawIdMap_
 
MonitorElementHits_perDetId_
 
MonitorElementHits_XvsY_
 
MonitorElementHits_ZvsR_
 
MonitorElementinvariantMass_
 
edm::EDGetTokenT< reco::CaloJetCollectionjetCollection_
 
MonitorElementjetPt_
 
double maxJetPt_
 
MonitorElementminJetDeltaR_
 
MonitorElementminTrackDeltaR_
 
edm::EDGetTokenT< reco::TrackCollectionreferenceTrackProducer_
 
bool runsOnReco_
 
MonitorElementsumCharge_
 
MonitorElementTrackCurvature_
 
edm::EDGetTokenT< reco::TrackCollectiontrackProducer_
 
MonitorElementTrackPtNegative_
 
MonitorElementTrackPtPositive_
 
MonitorElementTrackQuality_
 
bool useSignedR_
 

Additional Inherited Members

- Public Types inherited from DQMEDAnalyzer
typedef dqm::reco::DQMStore DQMStore
 
typedef dqm::reco::MonitorElement MonitorElement
 
- 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::ProducerBase
ProducesCollector producesCollector ()
 
- 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 ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes ()
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes (ESInputTag const &tag)
 
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

DQM/TrackerMonitorTrack/src/TkAlCaRecoMonitor.cc Monitoring special quantities related to Tracker Alignment AlCaReco Production.

Definition at line 32 of file TkAlCaRecoMonitor.h.

Constructor & Destructor Documentation

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

Definition at line 27 of file TkAlCaRecoMonitor.cc.

References conf_, edm::ParameterSet::getParameter(), jetCollection_, referenceTrackProducer_, and trackProducer_.

27  {
28  conf_ = iConfig;
29  trackProducer_ = consumes<reco::TrackCollection>(conf_.getParameter<edm::InputTag>("TrackProducer"));
31  consumes<reco::TrackCollection>(conf_.getParameter<edm::InputTag>("ReferenceTrackProducer"));
32  jetCollection_ = mayConsume<reco::CaloJetCollection>(conf_.getParameter<edm::InputTag>("CaloJetCollection"));
33 }
T getParameter(std::string const &) const
edm::EDGetTokenT< reco::TrackCollection > trackProducer_
edm::EDGetTokenT< reco::CaloJetCollection > jetCollection_
edm::ParameterSet conf_
edm::EDGetTokenT< reco::TrackCollection > referenceTrackProducer_
TkAlCaRecoMonitor::~TkAlCaRecoMonitor ( )
override

Definition at line 35 of file TkAlCaRecoMonitor.cc.

35 {}

Member Function Documentation

void TkAlCaRecoMonitor::analyze ( const edm::Event iEvent,
const edm::EventSetup iSetup 
)
override

Definition at line 194 of file TkAlCaRecoMonitor.cc.

References AlCaRecoTrackEfficiency_, TtFullHadDaughter::B, binByRawId_, daughterMass_, PbPb_ZMuSkimMuonDPG_cff::deltaR, HGC3DClusterGenMatchSelector_cfi::dR, MillePedeFileConverter_cfg::e, dqm::impl::MonitorElement::Fill(), fillHitmaps(), fillInvariantMass_, fillRawIdMap(), fillRawIdMap_, geometry, edm::EventSetup::get(), edm::Event::getByToken(), mps_fire::i, MagneticField::inTesla(), invariantMass_, edm::ESHandleBase::isValid(), edm::HandleBase::isValid(), jetCollection_, jetPt_, singleTopDQM_cfi::jets, HLT_2018_cff::magneticField, maxJetPt_, ALCARECOTkAlMuonIsolated_cff::minJetDeltaR, minJetDeltaR_, minTrackDeltaR_, reco::TrackBase::qualitySize, referenceTrackProducer_, runsOnReco_, mathSSE::sqrt(), sumCharge_, HLT_2018_cff::track, duplicaterechits_cfi::trackCollection, TrackCurvature_, trackProducer_, TrackPtNegative_, TrackPtPositive_, TrackQuality_, and PV3DBase< T, PVType, FrameType >::z().

194  {
196  iEvent.getByToken(trackProducer_, trackCollection);
197  if (!trackCollection.isValid()) {
198  edm::LogError("Alignment") << "invalid trackcollection encountered!";
199  return;
200  }
201 
202  edm::Handle<reco::TrackCollection> referenceTrackCollection;
203  iEvent.getByToken(referenceTrackProducer_, referenceTrackCollection);
204  if (!trackCollection.isValid()) {
205  edm::LogError("Alignment") << "invalid reference track-collection encountered!";
206  return;
207  }
208 
210  iSetup.get<TrackerDigiGeometryRecord>().get(geometry);
211  if (!geometry.isValid()) {
212  edm::LogError("Alignment") << "invalid geometry found in event setup!";
213  }
214 
216  iSetup.get<IdealMagneticFieldRecord>().get(magneticField);
217  if (!magneticField.isValid()) {
218  edm::LogError("Alignment") << "invalid magnetic field configuration encountered!";
219  return;
220  }
221 
223  if (runsOnReco_) {
224  iEvent.getByToken(jetCollection_, jets);
225  if (!jets.isValid()) {
226  edm::LogError("Alignment") << "no jet collection found in event!";
227  }
228  }
229  // fill only once - not yet in beginJob since no access to geometry
230  if (fillRawIdMap_ && binByRawId_.empty())
231  this->fillRawIdMap(*geometry);
232 
233  AlCaRecoTrackEfficiency_->Fill(static_cast<double>((*trackCollection).size()) / (*referenceTrackCollection).size());
234 
235  double sumOfCharges = 0;
236  for (reco::TrackCollection::const_iterator track = (*trackCollection).begin(); track < (*trackCollection).end();
237  ++track) {
238  double dR = 0;
239  if (runsOnReco_) {
240  double minJetDeltaR = 10; // some number > 2pi
241  for (reco::CaloJetCollection::const_iterator itJet = jets->begin(); itJet != jets->end(); ++itJet) {
242  jetPt_->Fill((*itJet).pt());
243  dR = deltaR((*track), (*itJet));
244  if ((*itJet).pt() > maxJetPt_ && dR < minJetDeltaR)
245  minJetDeltaR = dR;
246 
247  // edm::LogInfo("Alignment") <<"> isolated: "<< isolated << " jetPt "<<
248  // (*itJet).pt() <<" deltaR: "<< deltaR(*(*it),(*itJet)) ;
249  }
250  minJetDeltaR_->Fill(minJetDeltaR);
251  }
252 
253  double minTrackDeltaR = 10; // some number > 2pi
254  for (reco::TrackCollection::const_iterator track2 = (*trackCollection).begin(); track2 < (*trackCollection).end();
255  ++track2) {
256  dR = deltaR((*track), (*track2));
257  if (dR < minTrackDeltaR && dR > 1e-6)
258  minTrackDeltaR = dR;
259  }
260 
261  for (int i = 0; i < reco::TrackBase::qualitySize; ++i) {
262  if ((*track).quality(reco::TrackBase::TrackQuality(i))) {
263  TrackQuality_->Fill(i);
264  }
265  }
266 
267  GlobalPoint gPoint((*track).vx(), (*track).vy(), (*track).vz());
268  double B = magneticField->inTesla(gPoint).z();
269  double curv = -(*track).charge() * 0.002998 * B / (*track).pt();
270  TrackCurvature_->Fill(curv);
271 
272  if ((*track).charge() > 0)
273  TrackPtPositive_->Fill((*track).pt());
274  if ((*track).charge() < 0)
275  TrackPtNegative_->Fill((*track).pt());
276 
277  minTrackDeltaR_->Fill(minTrackDeltaR);
278  fillHitmaps(*track, *geometry);
279  sumOfCharges += (*track).charge();
280  }
281 
282  sumCharge_->Fill(sumOfCharges);
283 
284  if (fillInvariantMass_) {
285  if ((*trackCollection).size() == 2) {
286  TLorentzVector track0(
287  (*trackCollection).at(0).px(),
288  (*trackCollection).at(0).py(),
289  (*trackCollection).at(0).pz(),
290  sqrt(((*trackCollection).at(0).p() * (*trackCollection).at(0).p()) + daughterMass_ * daughterMass_));
291  TLorentzVector track1(
292  (*trackCollection).at(1).px(),
293  (*trackCollection).at(1).py(),
294  (*trackCollection).at(1).pz(),
295  sqrt(((*trackCollection).at(1).p() * (*trackCollection).at(1).p()) + daughterMass_ * daughterMass_));
296  TLorentzVector mother = track0 + track1;
297 
298  invariantMass_->Fill(mother.M());
299  } else {
300  edm::LogInfo("Alignment") << "wrong number of tracks trackcollection encountered: " << (*trackCollection).size();
301  }
302  }
303 }
std::map< int, int > binByRawId_
void fillRawIdMap(const TrackerGeometry &geometry)
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:525
TrackQuality
track quality
Definition: TrackBase.h:150
MonitorElement * TrackQuality_
MonitorElement * minJetDeltaR_
void Fill(long long x)
MonitorElement * AlCaRecoTrackEfficiency_
MonitorElement * sumCharge_
edm::EDGetTokenT< reco::TrackCollection > trackProducer_
T sqrt(T t)
Definition: SSEVec.h:19
T z() const
Definition: PV3DBase.h:61
MonitorElement * invariantMass_
MonitorElement * TrackPtNegative_
void fillHitmaps(const reco::Track &track, const TrackerGeometry &geometry)
edm::EDGetTokenT< reco::CaloJetCollection > jetCollection_
static const std::string B
bool isValid() const
Definition: HandleBase.h:70
virtual GlobalVector inTesla(const GlobalPoint &gp) const =0
Field value ad specified global point, in Tesla.
MonitorElement * TrackCurvature_
MonitorElement * jetPt_
ESHandle< TrackerGeometry > geometry
T get() const
Definition: EventSetup.h:73
MonitorElement * minTrackDeltaR_
bool isValid() const
Definition: ESHandle.h:44
edm::EDGetTokenT< reco::TrackCollection > referenceTrackProducer_
MonitorElement * TrackPtPositive_
void TkAlCaRecoMonitor::bookHistograms ( DQMStore::IBooker iBooker,
edm::Run const &  ,
edm::EventSetup const &   
)
overridevirtual

Implements DQMEDAnalyzer.

Definition at line 37 of file TkAlCaRecoMonitor.cc.

References AlCaRecoTrackEfficiency_, HLTSiStripMonitoring_cff::AlgoName, dqm::dqmstoreimpl::DQMStore::IBooker::book1D(), dqm::dqmstoreimpl::DQMStore::IBooker::book2D(), conf_, daughterMass_, fillInvariantMass_, fillRawIdMap_, edm::ParameterSet::getParameter(), dqm::impl::MonitorElement::getTH1(), Hits_perDetId_, Hits_XvsY_, Hits_ZvsR_, mps_fire::i, invariantMass_, jetPt_, TkAlCaRecoMonitor_cfi::JetPtBin, TkAlCaRecoMonitor_cfi::JetPtMax, TkAlCaRecoMonitor_cfi::JetPtMin, edm::EDConsumerBase::labelsForToken(), ALCARECOTkAlDQM_cff::MassBin, ALCARECOTkAlDQM_cff::MassMax, ALCARECOTkAlDQM_cff::MassMin, maxJetPt_, minJetDeltaR_, TkAlCaRecoMonitor_cfi::MinJetDeltaRBin, TkAlCaRecoMonitor_cfi::MinJetDeltaRMax, TkAlCaRecoMonitor_cfi::MinJetDeltaRMin, minTrackDeltaR_, TkAlCaRecoMonitor_cfi::MinTrackDeltaRBin, TkAlCaRecoMonitor_cfi::MinTrackDeltaRMax, TkAlCaRecoMonitor_cfi::MinTrackDeltaRMin, edm::ProductLabels::module, reco::TrackBase::qualityName(), reco::TrackBase::qualitySize, photonAnalyzer_cfi::rBin, referenceTrackProducer_, photonAnalyzer_cfi::rMax, photonAnalyzer_cfi::rMin, runsOnReco_, dqm::impl::MonitorElement::setAxisTitle(), dqm::dqmstoreimpl::DQMStore::IBooker::setCurrentFolder(), AlCaHLTBitMon_QueryRunRegistry::string, sumCharge_, ALCARECOTkAlDQM_cff::SumChargeBin, ALCARECOTkAlDQM_cff::SumChargeMax, ALCARECOTkAlDQM_cff::SumChargeMin, TrackCurvature_, TkAlCaRecoMonitor_cfi::TrackCurvatureBin, TkAlCaRecoMonitor_cfi::TrackCurvatureMax, TkAlCaRecoMonitor_cfi::TrackCurvatureMin, TkAlCaRecoMonitor_cfi::TrackEfficiencyBin, TkAlCaRecoMonitor_cfi::TrackEfficiencyMax, TkAlCaRecoMonitor_cfi::TrackEfficiencyMin, trackProducer_, TrackPtNegative_, TrackPtPositive_, TrackQuality_, useSignedR_, photonAnalyzer_cfi::zBin, and photonAnalyzer_cfi::zMax.

37  {
38  std::string histname; // for naming the histograms according to algorithm used
39 
41  std::string MEFolderName = conf_.getParameter<std::string>("FolderName");
42 
43  daughterMass_ = conf_.getParameter<double>("daughterMass");
44 
45  maxJetPt_ = conf_.getParameter<double>("maxJetPt");
46 
47  iBooker.setCurrentFolder(MEFolderName + "/TkAlignmentSpecific");
48  fillInvariantMass_ = conf_.getParameter<bool>("fillInvariantMass");
49  runsOnReco_ = conf_.getParameter<bool>("runsOnReco");
50  useSignedR_ = conf_.getParameter<bool>("useSignedR");
51  fillRawIdMap_ = conf_.getParameter<bool>("fillRawIdMap");
52 
53  //
54  unsigned int MassBin = conf_.getParameter<unsigned int>("MassBin");
55  double MassMin = conf_.getParameter<double>("MassMin");
56  double MassMax = conf_.getParameter<double>("MassMax");
57 
58  if (fillInvariantMass_) {
59  histname = "InvariantMass_";
60  invariantMass_ = iBooker.book1D(histname + AlgoName, histname + AlgoName, MassBin, MassMin, MassMax);
61  invariantMass_->setAxisTitle("invariant Mass / GeV");
62  } else {
63  invariantMass_ = nullptr;
64  }
65 
66  unsigned int TrackPtPositiveBin = conf_.getParameter<unsigned int>("TrackPtBin");
67  double TrackPtPositiveMin = conf_.getParameter<double>("TrackPtMin");
68  double TrackPtPositiveMax = conf_.getParameter<double>("TrackPtMax");
69 
70  histname = "TrackPtPositive_";
71  TrackPtPositive_ = iBooker.book1D(
72  histname + AlgoName, histname + AlgoName, TrackPtPositiveBin, TrackPtPositiveMin, TrackPtPositiveMax);
73  TrackPtPositive_->setAxisTitle("p_{T} of tracks charge > 0");
74 
75  unsigned int TrackPtNegativeBin = conf_.getParameter<unsigned int>("TrackPtBin");
76  double TrackPtNegativeMin = conf_.getParameter<double>("TrackPtMin");
77  double TrackPtNegativeMax = conf_.getParameter<double>("TrackPtMax");
78 
79  histname = "TrackPtNegative_";
80  TrackPtNegative_ = iBooker.book1D(
81  histname + AlgoName, histname + AlgoName, TrackPtNegativeBin, TrackPtNegativeMin, TrackPtNegativeMax);
82  TrackPtNegative_->setAxisTitle("p_{T} of tracks charge < 0");
83 
84  histname = "TrackQuality_";
85  TrackQuality_ = iBooker.book1D(
86  histname + AlgoName, histname + AlgoName, reco::TrackBase::qualitySize, -0.5, reco::TrackBase::qualitySize - 0.5);
87  TrackQuality_->setAxisTitle("quality");
88  for (int i = 0; i < reco::TrackBase::qualitySize; ++i) {
89  TrackQuality_->getTH1()->GetXaxis()->SetBinLabel(
91  }
92 
93  unsigned int SumChargeBin = conf_.getParameter<unsigned int>("SumChargeBin");
94  double SumChargeMin = conf_.getParameter<double>("SumChargeMin");
95  double SumChargeMax = conf_.getParameter<double>("SumChargeMax");
96 
97  histname = "SumCharge_";
98  sumCharge_ = iBooker.book1D(histname + AlgoName, histname + AlgoName, SumChargeBin, SumChargeMin, SumChargeMax);
99  sumCharge_->setAxisTitle("#SigmaCharge");
100 
101  unsigned int TrackCurvatureBin = conf_.getParameter<unsigned int>("TrackCurvatureBin");
102  double TrackCurvatureMin = conf_.getParameter<double>("TrackCurvatureMin");
103  double TrackCurvatureMax = conf_.getParameter<double>("TrackCurvatureMax");
104 
105  histname = "TrackCurvature_";
107  iBooker.book1D(histname + AlgoName, histname + AlgoName, TrackCurvatureBin, TrackCurvatureMin, TrackCurvatureMax);
108  TrackCurvature_->setAxisTitle("#kappa track");
109 
110  if (runsOnReco_) {
111  unsigned int JetPtBin = conf_.getParameter<unsigned int>("JetPtBin");
112  double JetPtMin = conf_.getParameter<double>("JetPtMin");
113  double JetPtMax = conf_.getParameter<double>("JetPtMax");
114 
115  histname = "JetPt_";
116  jetPt_ = iBooker.book1D(histname + AlgoName, histname + AlgoName, JetPtBin, JetPtMin, JetPtMax);
117  jetPt_->setAxisTitle("jet p_{T} / GeV");
118 
119  unsigned int MinJetDeltaRBin = conf_.getParameter<unsigned int>("MinJetDeltaRBin");
120  double MinJetDeltaRMin = conf_.getParameter<double>("MinJetDeltaRMin");
121  double MinJetDeltaRMax = conf_.getParameter<double>("MinJetDeltaRMax");
122 
123  histname = "MinJetDeltaR_";
124  minJetDeltaR_ =
125  iBooker.book1D(histname + AlgoName, histname + AlgoName, MinJetDeltaRBin, MinJetDeltaRMin, MinJetDeltaRMax);
126  minJetDeltaR_->setAxisTitle("minimal Jet #DeltaR / rad");
127  } else {
128  jetPt_ = nullptr;
129  minJetDeltaR_ = nullptr;
130  }
131 
132  unsigned int MinTrackDeltaRBin = conf_.getParameter<unsigned int>("MinTrackDeltaRBin");
133  double MinTrackDeltaRMin = conf_.getParameter<double>("MinTrackDeltaRMin");
134  double MinTrackDeltaRMax = conf_.getParameter<double>("MinTrackDeltaRMax");
135 
136  histname = "MinTrackDeltaR_";
138  iBooker.book1D(histname + AlgoName, histname + AlgoName, MinTrackDeltaRBin, MinTrackDeltaRMin, MinTrackDeltaRMax);
139  minTrackDeltaR_->setAxisTitle("minimal Track #DeltaR / rad");
140 
141  unsigned int TrackEfficiencyBin = conf_.getParameter<unsigned int>("TrackEfficiencyBin");
142  double TrackEfficiencyMin = conf_.getParameter<double>("TrackEfficiencyMin");
143  double TrackEfficiencyMax = conf_.getParameter<double>("TrackEfficiencyMax");
144 
145  histname = "AlCaRecoTrackEfficiency_";
146  AlCaRecoTrackEfficiency_ = iBooker.book1D(
147  histname + AlgoName, histname + AlgoName, TrackEfficiencyBin, TrackEfficiencyMin, TrackEfficiencyMax);
148  Labels l_tp, l_rtp;
151  AlCaRecoTrackEfficiency_->setAxisTitle("n(" + std::string(l_tp.module) + ") / n(" + std::string(l_rtp.module) + ")");
152 
153  int zBin = conf_.getParameter<unsigned int>("HitMapsZBin"); // 300
154  double zMax = conf_.getParameter<double>("HitMapZMax"); // 300.0; //cm
155 
156  int rBin = conf_.getParameter<unsigned int>("HitMapsRBin"); // 120;
157  double rMax = conf_.getParameter<double>("HitMapRMax"); // 120.0; //cm
158 
159  histname = "Hits_ZvsR_";
160  double rMin = 0.0;
161  if (useSignedR_)
162  rMin = -rMax;
163 
164  Hits_ZvsR_ = iBooker.book2D(histname + AlgoName, histname + AlgoName, zBin, -zMax, zMax, rBin, rMin, rMax);
165 
166  histname = "Hits_XvsY_";
167  Hits_XvsY_ = iBooker.book2D(histname + AlgoName, histname + AlgoName, rBin, -rMax, rMax, rBin, -rMax, rMax);
168 
169  if (fillRawIdMap_) {
170  histname = "Hits_perDetId_";
171 
172  // leads to differences in axsis between samples??
173  // int nModules = binByRawId_.size();
174  // Hits_perDetId_ = iBooker.book1D(histname+AlgoName, histname+AlgoName,
175  // nModules, static_cast<double>(nModules) -0.5,
176  // static_cast<double>(nModules) -0.5);
177  Hits_perDetId_ = iBooker.book1D(histname + AlgoName, histname + AlgoName, 16601, -0.5, 16600.5);
178  Hits_perDetId_->setAxisTitle("rawId Bins");
179 
181  // std::stringstream binLabel;
182  // for( std::map<int,int>::iterator it = binByRawId_.begin(); it !=
183  // binByRawId_.end(); ++it ){
184  // binLabel.str() = "";
185  // binLabel << (*it).first;
186  // Hits_perDetId_->getTH1()->GetXaxis()->SetBinLabel( (*it).second +1,
187  // binLabel.str().c_str());
188  // }
189  }
190 }
T getParameter(std::string const &) const
static std::string qualityName(TrackQuality)
Definition: TrackBase.h:551
TrackQuality
track quality
Definition: TrackBase.h:150
MonitorElement * TrackQuality_
MonitorElement * minJetDeltaR_
MonitorElement * Hits_XvsY_
MonitorElement * Hits_ZvsR_
MonitorElement * AlCaRecoTrackEfficiency_
MonitorElement * sumCharge_
edm::EDGetTokenT< reco::TrackCollection > trackProducer_
MonitorElement * invariantMass_
MonitorElement * TrackPtNegative_
ProductLabels Labels
MonitorElement * Hits_perDetId_
MonitorElement * TrackCurvature_
MonitorElement * jetPt_
edm::ParameterSet conf_
void labelsForToken(EDGetToken iToken, Labels &oLabels) const
MonitorElement * minTrackDeltaR_
edm::EDGetTokenT< reco::TrackCollection > referenceTrackProducer_
MonitorElement * TrackPtPositive_
virtual void setAxisTitle(const std::string &title, int axis=1)
set x-, y- or z-axis title (axis=1, 2, 3 respectively)
void TkAlCaRecoMonitor::fillHitmaps ( const reco::Track track,
const TrackerGeometry geometry 
)
private

Definition at line 305 of file TkAlCaRecoMonitor.cc.

References binByRawId_, dqm::impl::MonitorElement::Fill(), fillRawIdMap_, TrackingRecHit::geographicalId(), Hits_perDetId_, Hits_XvsY_, Hits_ZvsR_, TrackerGeometry::idToDet(), alignCSCRings::r, reco::Track::recHitsBegin(), reco::Track::recHitsEnd(), mathSSE::sqrt(), and useSignedR_.

Referenced by analyze().

305  {
306  for (trackingRecHit_iterator iHit = track.recHitsBegin(); iHit != track.recHitsEnd(); ++iHit) {
307  if ((*iHit)->isValid()) {
308  const TrackingRecHit *hit = (*iHit);
309  const DetId geoId(hit->geographicalId());
310  const GeomDet *gd = geometry.idToDet(geoId);
311  // since 2_1_X local hit positions are transient. taking center of the hit
312  // module for now. The alternative would be the coarse estimation or a
313  // refit.
314  // const GlobalPoint globP( gd->toGlobal( hit->localPosition() ) );
315  const GlobalPoint globP(gd->toGlobal(Local3DPoint(0., 0., 0.)));
316  double r = sqrt(globP.x() * globP.x() + globP.y() * globP.y());
317  if (useSignedR_)
318  r *= globP.y() / fabs(globP.y());
319 
320  Hits_ZvsR_->Fill(globP.z(), r);
321  Hits_XvsY_->Fill(globP.x(), globP.y());
322 
323  if (fillRawIdMap_)
324  Hits_perDetId_->Fill(binByRawId_[geoId.rawId()]);
325  }
326  }
327 }
std::map< int, int > binByRawId_
MonitorElement * Hits_XvsY_
MonitorElement * Hits_ZvsR_
void Fill(long long x)
T sqrt(T t)
Definition: SSEVec.h:19
trackingRecHit_iterator recHitsBegin() const
Iterator to first hit on the track.
Definition: Track.h:88
Definition: DetId.h:17
MonitorElement * Hits_perDetId_
const TrackerGeomDet * idToDet(DetId) const override
DetId geographicalId() const
trackingRecHit_iterator recHitsEnd() const
Iterator to last hit on the track.
Definition: Track.h:91
void TkAlCaRecoMonitor::fillRawIdMap ( const TrackerGeometry geometry)
private

Definition at line 329 of file TkAlCaRecoMonitor.cc.

References binByRawId_, DEFINE_FWK_MODULE, TrackerGeometry::detUnitIds(), and mps_fire::i.

Referenced by analyze().

329  {
330  std::vector<int> sortedRawIds;
331  for (std::vector<DetId>::const_iterator iDetId = geometry.detUnitIds().begin(); iDetId != geometry.detUnitIds().end();
332  ++iDetId) {
333  sortedRawIds.push_back((*iDetId).rawId());
334  }
335  std::sort(sortedRawIds.begin(), sortedRawIds.end());
336 
337  int i = 0;
338  for (std::vector<int>::iterator iRawId = sortedRawIds.begin(); iRawId != sortedRawIds.end(); ++iRawId) {
339  binByRawId_[*iRawId] = i;
340  ++i;
341  }
342 }
const DetIdContainer & detUnitIds() const override
Returm a vector of all GeomDetUnit DetIds.
std::map< int, int > binByRawId_

Member Data Documentation

MonitorElement* TkAlCaRecoMonitor::AlCaRecoTrackEfficiency_
private

Definition at line 56 of file TkAlCaRecoMonitor.h.

Referenced by analyze(), and bookHistograms().

std::map<int, int> TkAlCaRecoMonitor::binByRawId_
private

Definition at line 74 of file TkAlCaRecoMonitor.h.

Referenced by analyze(), fillHitmaps(), and fillRawIdMap().

edm::ParameterSet TkAlCaRecoMonitor::conf_
private

Definition at line 45 of file TkAlCaRecoMonitor.h.

Referenced by bookHistograms(), and TkAlCaRecoMonitor().

double TkAlCaRecoMonitor::daughterMass_
private

Definition at line 73 of file TkAlCaRecoMonitor.h.

Referenced by analyze(), and bookHistograms().

bool TkAlCaRecoMonitor::fillInvariantMass_
private

Definition at line 65 of file TkAlCaRecoMonitor.h.

Referenced by analyze(), and bookHistograms().

bool TkAlCaRecoMonitor::fillRawIdMap_
private

Definition at line 66 of file TkAlCaRecoMonitor.h.

Referenced by analyze(), bookHistograms(), and fillHitmaps().

MonitorElement* TkAlCaRecoMonitor::Hits_perDetId_
private

Definition at line 57 of file TkAlCaRecoMonitor.h.

Referenced by bookHistograms(), and fillHitmaps().

MonitorElement* TkAlCaRecoMonitor::Hits_XvsY_
private

Definition at line 63 of file TkAlCaRecoMonitor.h.

Referenced by bookHistograms(), and fillHitmaps().

MonitorElement* TkAlCaRecoMonitor::Hits_ZvsR_
private

Definition at line 62 of file TkAlCaRecoMonitor.h.

Referenced by bookHistograms(), and fillHitmaps().

MonitorElement* TkAlCaRecoMonitor::invariantMass_
private

Definition at line 50 of file TkAlCaRecoMonitor.h.

Referenced by analyze(), and bookHistograms().

edm::EDGetTokenT<reco::CaloJetCollection> TkAlCaRecoMonitor::jetCollection_
private

Definition at line 72 of file TkAlCaRecoMonitor.h.

Referenced by analyze(), and TkAlCaRecoMonitor().

MonitorElement* TkAlCaRecoMonitor::jetPt_
private

Definition at line 53 of file TkAlCaRecoMonitor.h.

Referenced by analyze(), and bookHistograms().

double TkAlCaRecoMonitor::maxJetPt_
private

Definition at line 47 of file TkAlCaRecoMonitor.h.

Referenced by analyze(), and bookHistograms().

MonitorElement* TkAlCaRecoMonitor::minJetDeltaR_
private

Definition at line 54 of file TkAlCaRecoMonitor.h.

Referenced by analyze(), and bookHistograms().

MonitorElement* TkAlCaRecoMonitor::minTrackDeltaR_
private

Definition at line 55 of file TkAlCaRecoMonitor.h.

Referenced by analyze(), and bookHistograms().

edm::EDGetTokenT<reco::TrackCollection> TkAlCaRecoMonitor::referenceTrackProducer_
private

Definition at line 71 of file TkAlCaRecoMonitor.h.

Referenced by analyze(), bookHistograms(), and TkAlCaRecoMonitor().

bool TkAlCaRecoMonitor::runsOnReco_
private

Definition at line 67 of file TkAlCaRecoMonitor.h.

Referenced by analyze(), and bookHistograms().

MonitorElement* TkAlCaRecoMonitor::sumCharge_
private

Definition at line 51 of file TkAlCaRecoMonitor.h.

Referenced by analyze(), and bookHistograms().

MonitorElement* TkAlCaRecoMonitor::TrackCurvature_
private

Definition at line 60 of file TkAlCaRecoMonitor.h.

Referenced by analyze(), and bookHistograms().

edm::EDGetTokenT<reco::TrackCollection> TkAlCaRecoMonitor::trackProducer_
private

Definition at line 70 of file TkAlCaRecoMonitor.h.

Referenced by analyze(), bookHistograms(), and TkAlCaRecoMonitor().

MonitorElement* TkAlCaRecoMonitor::TrackPtNegative_
private

Definition at line 59 of file TkAlCaRecoMonitor.h.

Referenced by analyze(), and bookHistograms().

MonitorElement* TkAlCaRecoMonitor::TrackPtPositive_
private

Definition at line 58 of file TkAlCaRecoMonitor.h.

Referenced by analyze(), and bookHistograms().

MonitorElement* TkAlCaRecoMonitor::TrackQuality_
private

Definition at line 52 of file TkAlCaRecoMonitor.h.

Referenced by analyze(), and bookHistograms().

bool TkAlCaRecoMonitor::useSignedR_
private

Definition at line 68 of file TkAlCaRecoMonitor.h.

Referenced by bookHistograms(), and fillHitmaps().