CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Member Functions | Private Attributes
TkAlCaRecoMonitor Class Reference

#include <DQM/TrackerMonitorTrack/src/TkAlCaRecoMonitor.cc>

Inheritance diagram for TkAlCaRecoMonitor:
edm::EDAnalyzer edm::EDConsumerBase

Public Member Functions

virtual void analyze (const edm::Event &, const edm::EventSetup &)
 
virtual void beginJob ()
 
virtual void endJob (void)
 
 TkAlCaRecoMonitor (const edm::ParameterSet &)
 
 ~TkAlCaRecoMonitor ()
 
- Public Member Functions inherited from edm::EDAnalyzer
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
 EDAnalyzer ()
 
ModuleDescription const & moduleDescription () const
 
std::string workerType () const
 
virtual ~EDAnalyzer ()
 
- Public Member Functions inherited from edm::EDConsumerBase
 EDConsumerBase ()
 
ProductHolderIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
std::vector
< ProductHolderIndexAndSkipBit >
const & 
itemsToGetFromEvent () const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
bool registeredToConsume (ProductHolderIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void updateLookup (BranchType iBranchType, ProductHolderIndexHelper const &)
 
virtual ~EDConsumerBase ()
 

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_
 
DQMStoredqmStore_
 
bool fillInvariantMass_
 
bool fillRawIdMap_
 
MonitorElementHits_perDetId_
 
MonitorElementHits_XvsY_
 
MonitorElementHits_ZvsR_
 
MonitorElementinvariantMass_
 
edm::EDGetTokenT
< reco::CaloJetCollection
jetCollection_
 
MonitorElementjetPt_
 
double maxJetPt_
 
MonitorElementminJetDeltaR_
 
MonitorElementminTrackDeltaR_
 
edm::EDGetTokenT
< reco::TrackCollection
referenceTrackProducer_
 
bool runsOnReco_
 
MonitorElementsumCharge_
 
MonitorElementTrackCurvature_
 
edm::EDGetTokenT
< reco::TrackCollection
trackProducer_
 
MonitorElementTrackPtNegative_
 
MonitorElementTrackPtPositive_
 
MonitorElementTrackQuality_
 
bool useSignedR_
 

Additional Inherited Members

- Public Types inherited from edm::EDAnalyzer
typedef EDAnalyzer ModuleType
 
- Static Public Member Functions inherited from edm::EDAnalyzer
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &)
 
- 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)
 

Detailed Description

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_, dqmStore_, edm::ParameterSet::getParameter(), jetCollection_, cppFunctionSkipper::operator, referenceTrackProducer_, and trackProducer_.

27  {
28  conf_ = iConfig;
29  trackProducer_ = consumes<reco::TrackCollection>(conf_.getParameter<edm::InputTag>("TrackProducer"));
30  referenceTrackProducer_ = consumes<reco::TrackCollection>(conf_.getParameter<edm::InputTag>("ReferenceTrackProducer"));
31  jetCollection_ = mayConsume<reco::CaloJetCollection>(conf_.getParameter<edm::InputTag>("CaloJetCollection"));
32 
34 }
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 ( )

Definition at line 36 of file TkAlCaRecoMonitor.cc.

36 { }

Member Function Documentation

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

Implements edm::EDAnalyzer.

Definition at line 187 of file TkAlCaRecoMonitor.cc.

References AlCaRecoTrackEfficiency_, binByRawId_, daughterMass_, deltaR(), PFRecoTauDiscriminationAgainstElectronDeadECAL_cfi::dR, alignCSCRings::e, MonitorElement::Fill(), fillHitmaps(), fillInvariantMass_, fillRawIdMap(), fillRawIdMap_, geometry, edm::EventSetup::get(), edm::Event::getByToken(), i, invariantMass_, edm::ESHandleBase::isValid(), edm::HandleBase::isValid(), jetCollection_, jetPt_, fwrapper::jets, maxJetPt_, minJetDeltaR_, minTrackDeltaR_, reco::TrackBase::qualitySize, referenceTrackProducer_, runsOnReco_, mathSSE::sqrt(), sumCharge_, TrackCurvature_, trackProducer_, TrackPtNegative_, TrackPtPositive_, and TrackQuality_.

187  {
188 
189  edm::Handle<reco::TrackCollection> trackCollection;
190  iEvent.getByToken(trackProducer_, trackCollection);
191  if (!trackCollection.isValid()){
192  edm::LogError("Alignment")<<"invalid trackcollection encountered!";
193  return;
194  }
195 
196  edm::Handle<reco::TrackCollection> referenceTrackCollection;
197  iEvent.getByToken(referenceTrackProducer_, referenceTrackCollection);
198  if (!trackCollection.isValid()){
199  edm::LogError("Alignment")<<"invalid reference track-collection encountered!";
200  return;
201  }
202 
204  iSetup.get<TrackerDigiGeometryRecord>().get(geometry);
205  if(! geometry.isValid()){
206  edm::LogError("Alignment")<<"invalid geometry found in event setup!";
207  }
208 
209  edm::ESHandle<MagneticField> magneticField;
210  iSetup.get<IdealMagneticFieldRecord>().get(magneticField);
211  if (!magneticField.isValid()){
212  edm::LogError("Alignment")<<"invalid magnetic field configuration encountered!";
213  return;
214  }
215 
217  if(runsOnReco_){
218  iEvent.getByToken(jetCollection_, jets);
219  if(! jets.isValid()){
220  edm::LogError("Alignment")<<"no jet collection found in event!";
221  }
222  }
223  // fill only once - not yet in beginJob since no access to geometry
224  if (fillRawIdMap_ && binByRawId_.empty()) this->fillRawIdMap(*geometry);
225 
226  AlCaRecoTrackEfficiency_->Fill( static_cast<double>((*trackCollection).size()) / (*referenceTrackCollection).size() );
227 
228  double sumOfCharges = 0;
229  for( reco::TrackCollection::const_iterator track = (*trackCollection).begin(); track < (*trackCollection).end(); ++track ){
230  double dR = 0;
231  if(runsOnReco_){
232  double minJetDeltaR = 10; // some number > 2pi
233  for(reco::CaloJetCollection::const_iterator itJet = jets->begin(); itJet != jets->end() ; ++itJet) {
234  jetPt_->Fill( (*itJet).pt() );
235  dR = deltaR((*track),(*itJet));
236  if((*itJet).pt() > maxJetPt_ && dR < minJetDeltaR)
237  minJetDeltaR = dR;
238 
239  //edm::LogInfo("Alignment") <<"> isolated: "<< isolated << " jetPt "<< (*itJet).pt() <<" deltaR: "<< deltaR(*(*it),(*itJet)) ;
240  }
241  minJetDeltaR_->Fill( minJetDeltaR );
242  }
243 
244  double minTrackDeltaR = 10; // some number > 2pi
245  for( reco::TrackCollection::const_iterator track2 = (*trackCollection).begin(); track2 < (*trackCollection).end(); ++track2 ){
246  dR = deltaR((*track),(*track2));
247  if(dR < minTrackDeltaR && dR > 1e-6)
248  minTrackDeltaR = dR;
249  }
250 
251  for ( int i = 0; i<reco::TrackBase::qualitySize; ++i){
252  if( (*track).quality( reco::TrackBase::TrackQuality(i) ) ){
253  TrackQuality_->Fill( i );
254  }
255  }
256 
257  GlobalPoint gPoint((*track).vx(), (*track).vy(), (*track).vz());
258  double B = magneticField->inTesla(gPoint).z();
259  double curv = -(*track).charge()*0.002998*B/(*track).pt();
260  TrackCurvature_->Fill( curv );
261 
262  if( (*track).charge() > 0 )
263  TrackPtPositive_->Fill( (*track).pt() );
264  if( (*track).charge() < 0 )
265  TrackPtNegative_->Fill( (*track).pt() );
266 
267  minTrackDeltaR_->Fill( minTrackDeltaR );
268  fillHitmaps( *track, *geometry );
269  sumOfCharges += (*track).charge();
270  }
271 
272  sumCharge_->Fill( sumOfCharges );
273 
274  if(fillInvariantMass_){
275  if((*trackCollection).size() == 2){
276  TLorentzVector track0((*trackCollection).at(0).px(),(*trackCollection).at(0).py(),(*trackCollection).at(0).pz(),
277  sqrt(((*trackCollection).at(0).p()*(*trackCollection).at(0).p())+daughterMass_*daughterMass_));
278  TLorentzVector track1((*trackCollection).at(1).px(),(*trackCollection).at(1).py(),(*trackCollection).at(1).pz(),
279  sqrt(((*trackCollection).at(1).p()*(*trackCollection).at(1).p())+daughterMass_*daughterMass_));
280  TLorentzVector mother = track0+track1;
281 
282  invariantMass_->Fill( mother.M() );
283  }else{
284  edm::LogInfo("Alignment")<<"wrong number of tracks trackcollection encountered: "<<(*trackCollection).size();
285  }
286  }
287 }
int i
Definition: DBlmapReader.cc:9
void fillRawIdMap(const TrackerGeometry &geometry)
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:434
TrackQuality
track quality
Definition: TrackBase.h:93
MonitorElement * TrackQuality_
MonitorElement * minJetDeltaR_
std::map< int, int > binByRawId_
void Fill(long long x)
MonitorElement * AlCaRecoTrackEfficiency_
MonitorElement * sumCharge_
edm::EDGetTokenT< reco::TrackCollection > trackProducer_
T sqrt(T t)
Definition: SSEVec.h:48
vector< PseudoJet > jets
MonitorElement * invariantMass_
MonitorElement * TrackPtNegative_
void fillHitmaps(const reco::Track &track, const TrackerGeometry &geometry)
edm::EDGetTokenT< reco::CaloJetCollection > jetCollection_
bool isValid() const
Definition: HandleBase.h:76
double deltaR(double eta1, double eta2, double phi1, double phi2)
Definition: TreeUtility.cc:17
const T & get() const
Definition: EventSetup.h:55
MonitorElement * TrackCurvature_
MonitorElement * jetPt_
ESHandle< TrackerGeometry > geometry
MonitorElement * minTrackDeltaR_
bool isValid() const
Definition: ESHandle.h:37
edm::EDGetTokenT< reco::TrackCollection > referenceTrackProducer_
MonitorElement * TrackPtPositive_
void TkAlCaRecoMonitor::beginJob ( void  )
virtual

Reimplemented from edm::EDAnalyzer.

Definition at line 38 of file TkAlCaRecoMonitor.cc.

References AlCaRecoTrackEfficiency_, DQMStore::book1D(), DQMStore::book2D(), conf_, daughterMass_, dqmStore_, fillInvariantMass_, fillRawIdMap_, edm::ParameterSet::getParameter(), MonitorElement::getTH1(), Hits_perDetId_, Hits_XvsY_, Hits_ZvsR_, i, invariantMass_, jetPt_, edm::EDConsumerBase::labelsForToken(), maxJetPt_, minJetDeltaR_, minTrackDeltaR_, edm::EDConsumerBase::Labels::module, NULL, reco::TrackBase::qualityName(), reco::TrackBase::qualitySize, referenceTrackProducer_, runsOnReco_, MonitorElement::setAxisTitle(), DQMStore::setCurrentFolder(), AlCaHLTBitMon_QueryRunRegistry::string, sumCharge_, TrackCurvature_, trackProducer_, TrackPtNegative_, TrackPtPositive_, TrackQuality_, and useSignedR_.

38  {
39 
40  std::string histname; //for naming the histograms according to algorithm used
41 
42  std::string AlgoName = conf_.getParameter<std::string>("AlgoName");
43  std::string MEFolderName = conf_.getParameter<std::string>("FolderName");
44 
45  daughterMass_ = conf_.getParameter<double>("daughterMass");
46 
47  maxJetPt_ = conf_.getParameter<double>("maxJetPt");
48 
49  dqmStore_->setCurrentFolder(MEFolderName+"/TkAlignmentSpecific");
50  fillInvariantMass_ = conf_.getParameter<bool>("fillInvariantMass");
51  runsOnReco_ = conf_.getParameter<bool>("runsOnReco");
52  useSignedR_ = conf_.getParameter<bool>("useSignedR");
53  fillRawIdMap_ = conf_.getParameter<bool>("fillRawIdMap");
54 
55  //
56  unsigned int MassBin = conf_.getParameter<unsigned int>("MassBin");
57  double MassMin = conf_.getParameter<double>("MassMin");
58  double MassMax = conf_.getParameter<double>("MassMax");
59 
61  histname = "InvariantMass_";
62  invariantMass_ = dqmStore_->book1D(histname+AlgoName, histname+AlgoName, MassBin, MassMin, MassMax);
63  invariantMass_->setAxisTitle("invariant Mass / GeV");
64  }else{
65  invariantMass_ = 0;
66  }
67 
68  unsigned int TrackPtPositiveBin = conf_.getParameter<unsigned int>("TrackPtBin");
69  double TrackPtPositiveMin = conf_.getParameter<double>("TrackPtMin");
70  double TrackPtPositiveMax = conf_.getParameter<double>("TrackPtMax");
71 
72  histname = "TrackPtPositive_";
73  TrackPtPositive_ = dqmStore_->book1D(histname+AlgoName, histname+AlgoName, TrackPtPositiveBin, TrackPtPositiveMin, TrackPtPositiveMax);
74  TrackPtPositive_->setAxisTitle("p_{T} of tracks charge > 0");
75 
76  unsigned int TrackPtNegativeBin = conf_.getParameter<unsigned int>("TrackPtBin");
77  double TrackPtNegativeMin = conf_.getParameter<double>("TrackPtMin");
78  double TrackPtNegativeMax = conf_.getParameter<double>("TrackPtMax");
79 
80  histname = "TrackPtNegative_";
81  TrackPtNegative_ = dqmStore_->book1D(histname+AlgoName, histname+AlgoName, TrackPtNegativeBin, TrackPtNegativeMin, TrackPtNegativeMax);
82  TrackPtNegative_->setAxisTitle("p_{T} of tracks charge < 0");
83 
84  histname = "TrackQuality_";
85  TrackQuality_ = dqmStore_->book1D(histname+AlgoName, histname+AlgoName,
87  TrackQuality_->setAxisTitle("quality");
88  for ( int i = 0; i<reco::TrackBase::qualitySize; ++i){
89  TrackQuality_->getTH1()->GetXaxis()->SetBinLabel(i+1,
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_ = dqmStore_->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_";
106  TrackCurvature_ = dqmStore_->book1D(histname+AlgoName, histname+AlgoName, TrackCurvatureBin, TrackCurvatureMin, TrackCurvatureMax);
107  TrackCurvature_->setAxisTitle("#kappa track");
108 
109  if( runsOnReco_ ){
110 
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_ = dqmStore_->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_ = dqmStore_->book1D(histname+AlgoName, histname+AlgoName, MinJetDeltaRBin, MinJetDeltaRMin, MinJetDeltaRMax);
125  minJetDeltaR_->setAxisTitle("minimal Jet #DeltaR / rad");
126  }else{
127  jetPt_ = NULL;
129  }
130 
131  unsigned int MinTrackDeltaRBin = conf_.getParameter<unsigned int>("MinTrackDeltaRBin");
132  double MinTrackDeltaRMin = conf_.getParameter<double>("MinTrackDeltaRMin");
133  double MinTrackDeltaRMax = conf_.getParameter<double>("MinTrackDeltaRMax");
134 
135  histname = "MinTrackDeltaR_";
136  minTrackDeltaR_ = dqmStore_->book1D(histname+AlgoName, histname+AlgoName, MinTrackDeltaRBin, MinTrackDeltaRMin, MinTrackDeltaRMax);
137  minTrackDeltaR_->setAxisTitle("minimal Track #DeltaR / rad");
138 
139  unsigned int TrackEfficiencyBin = conf_.getParameter<unsigned int>("TrackEfficiencyBin");
140  double TrackEfficiencyMin = conf_.getParameter<double>("TrackEfficiencyMin");
141  double TrackEfficiencyMax = conf_.getParameter<double>("TrackEfficiencyMax");
142 
143  histname = "AlCaRecoTrackEfficiency_";
144  AlCaRecoTrackEfficiency_ = dqmStore_->book1D(histname+AlgoName, histname+AlgoName, TrackEfficiencyBin, TrackEfficiencyMin, TrackEfficiencyMax);
145  Labels l_tp, l_rtp;
148  AlCaRecoTrackEfficiency_->setAxisTitle("n("+std::string(l_tp.module)+") / n("+std::string(l_rtp.module)+")");
149 
150  int zBin = conf_.getParameter<unsigned int>("HitMapsZBin"); //300
151  double zMax = conf_.getParameter<double>("HitMapZMax"); //300.0; //cm
152 
153  int rBin = conf_.getParameter<unsigned int>("HitMapsRBin");//120;
154  double rMax = conf_.getParameter<double>("HitMapRMax"); //120.0; //cm
155 
156  histname = "Hits_ZvsR_";
157  double rMin = 0.0;
158  if( useSignedR_ )
159  rMin = -rMax;
160 
161  Hits_ZvsR_ = dqmStore_->book2D(histname+AlgoName, histname+AlgoName, zBin, -zMax, zMax, rBin, rMin, rMax);
162 
163  histname = "Hits_XvsY_";
164  Hits_XvsY_ = dqmStore_->book2D(histname+AlgoName, histname+AlgoName, rBin, -rMax, rMax, rBin, -rMax, rMax);
165 
166  if( fillRawIdMap_){
167  histname = "Hits_perDetId_";
168 
169  //leads to differences in axsis between samples??
170  //int nModules = binByRawId_.size();
171  //Hits_perDetId_ = dqmStore_->book1D(histname+AlgoName, histname+AlgoName, nModules, static_cast<double>(nModules) -0.5, static_cast<double>(nModules) -0.5);
172  Hits_perDetId_ = dqmStore_->book1D(histname+AlgoName, histname+AlgoName, 16601,-0.5, 16600.5 );
173  Hits_perDetId_->setAxisTitle("rawId Bins");
174 
176  // std::stringstream binLabel;
177  // for( std::map<int,int>::iterator it = binByRawId_.begin(); it != binByRawId_.end(); ++it ){
178  // binLabel.str() = "";
179  // binLabel << (*it).first;
180  // Hits_perDetId_->getTH1()->GetXaxis()->SetBinLabel( (*it).second +1, binLabel.str().c_str());
181  // }
182  }
183 }
T getParameter(std::string const &) const
int i
Definition: DBlmapReader.cc:9
static std::string qualityName(TrackQuality)
Definition: TrackBase.h:404
MonitorElement * book1D(const char *name, const char *title, int nchX, double lowX, double highX)
Book 1D histogram.
Definition: DQMStore.cc:872
TrackQuality
track quality
Definition: TrackBase.h:93
MonitorElement * TrackQuality_
#define NULL
Definition: scimark2.h:8
MonitorElement * minJetDeltaR_
MonitorElement * Hits_XvsY_
MonitorElement * Hits_ZvsR_
MonitorElement * AlCaRecoTrackEfficiency_
MonitorElement * sumCharge_
edm::EDGetTokenT< reco::TrackCollection > trackProducer_
MonitorElement * invariantMass_
MonitorElement * TrackPtNegative_
TH1 * getTH1(void) const
MonitorElement * Hits_perDetId_
MonitorElement * TrackCurvature_
MonitorElement * jetPt_
edm::ParameterSet conf_
void labelsForToken(EDGetToken iToken, Labels &oLabels) const
MonitorElement * minTrackDeltaR_
MonitorElement * book2D(const char *name, const char *title, int nchX, double lowX, double highX, int nchY, double lowY, double highY)
Book 2D histogram.
Definition: DQMStore.cc:1000
edm::EDGetTokenT< reco::TrackCollection > referenceTrackProducer_
MonitorElement * TrackPtPositive_
void setAxisTitle(const std::string &title, int axis=1)
set x-, y- or z-axis title (axis=1, 2, 3 respectively)
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:584
void TkAlCaRecoMonitor::endJob ( void  )
virtual

Reimplemented from edm::EDAnalyzer.

Definition at line 331 of file TkAlCaRecoMonitor.cc.

References conf_, dqmStore_, edm::ParameterSet::getParameter(), dumpDBToFile_GT_ttrig_cfg::outputFileName, DQMStore::save(), and AlCaHLTBitMon_QueryRunRegistry::string.

331  {
332  bool outputMEsInRootFile = conf_.getParameter<bool>("OutputMEsInRootFile");
334  if(outputMEsInRootFile){
335  //dqmStore_->showDirStructure();
336  dqmStore_->save(outputFileName);
337  }
338 }
T getParameter(std::string const &) const
void save(const std::string &filename, const std::string &path="", const std::string &pattern="", const std::string &rewrite="", const uint32_t run=0, SaveReferenceTag ref=SaveWithReference, int minStatus=dqm::qstatus::STATUS_OK, const std::string &fileupdate="RECREATE")
Definition: DQMStore.cc:2296
edm::ParameterSet conf_
void TkAlCaRecoMonitor::fillHitmaps ( const reco::Track track,
const TrackerGeometry geometry 
)
private

Definition at line 289 of file TkAlCaRecoMonitor.cc.

References binByRawId_, 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().

290 {
291  for (trackingRecHit_iterator iHit = track.recHitsBegin(); iHit != track.recHitsEnd(); ++iHit) {
292  if( (*iHit)->isValid() ){
293  const TrackingRecHit *hit = (*iHit).get();
294  const DetId geoId(hit->geographicalId());
295  const GeomDet* gd = geometry.idToDet(geoId);
296  // since 2_1_X local hit positions are transient. taking center of the hit module for now.
297  // The alternative would be the coarse estimation or a refit.
298  //const GlobalPoint globP( gd->toGlobal( hit->localPosition() ) );
299  const GlobalPoint globP( gd->toGlobal( Local3DPoint(0.,0.,0.) ) );
300  double r = sqrt( globP.x()*globP.x() + globP.y()*globP.y() );
301  if( useSignedR_ )
302  r*= globP.y() / fabs( globP.y() );
303 
304  Hits_ZvsR_->Fill( globP.z(), r );
305  Hits_XvsY_->Fill( globP.x(), globP.y() );
306 
307  if( fillRawIdMap_)
308  Hits_perDetId_->Fill( binByRawId_[ geoId.rawId() ]);
309  }
310  }
311 }
std::map< int, int > binByRawId_
MonitorElement * Hits_XvsY_
MonitorElement * Hits_ZvsR_
void Fill(long long x)
T sqrt(T t)
Definition: SSEVec.h:48
trackingRecHit_iterator recHitsBegin() const
Iterator to first hit on the track.
Definition: Track.h:62
virtual const GeomDet * idToDet(DetId) const
Definition: DetId.h:18
MonitorElement * Hits_perDetId_
DetId geographicalId() const
trackingRecHit_iterator recHitsEnd() const
Iterator to last hit on the track.
Definition: Track.h:64
void TkAlCaRecoMonitor::fillRawIdMap ( const TrackerGeometry geometry)
private

Definition at line 313 of file TkAlCaRecoMonitor.cc.

References binByRawId_, TrackerGeometry::detUnitIds(), i, and python.multivaluedict::sort().

Referenced by analyze().

314 {
315  std::vector<int> sortedRawIds;
316  for (std::vector<DetId>::const_iterator iDetId = geometry.detUnitIds().begin();
317  iDetId != geometry.detUnitIds().end(); ++iDetId) {
318  sortedRawIds.push_back((*iDetId).rawId());
319  }
320  std::sort(sortedRawIds.begin(), sortedRawIds.end());
321 
322  int i = 0;
323  for (std::vector<int>::iterator iRawId = sortedRawIds.begin();
324  iRawId != sortedRawIds.end(); ++iRawId){
325  binByRawId_[*iRawId] = i;
326  ++i;
327  }
328 }
int i
Definition: DBlmapReader.cc:9
std::map< int, int > binByRawId_
virtual const DetIdContainer & detUnitIds() const
Returm a vector of all GeomDetUnit DetIds.

Member Data Documentation

MonitorElement* TkAlCaRecoMonitor::AlCaRecoTrackEfficiency_
private

Definition at line 58 of file TkAlCaRecoMonitor.h.

Referenced by analyze(), and beginJob().

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

Definition at line 76 of file TkAlCaRecoMonitor.h.

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

edm::ParameterSet TkAlCaRecoMonitor::conf_
private

Definition at line 47 of file TkAlCaRecoMonitor.h.

Referenced by beginJob(), endJob(), and TkAlCaRecoMonitor().

double TkAlCaRecoMonitor::daughterMass_
private

Definition at line 75 of file TkAlCaRecoMonitor.h.

Referenced by analyze(), and beginJob().

DQMStore* TkAlCaRecoMonitor::dqmStore_
private

Definition at line 46 of file TkAlCaRecoMonitor.h.

Referenced by beginJob(), endJob(), and TkAlCaRecoMonitor().

bool TkAlCaRecoMonitor::fillInvariantMass_
private

Definition at line 67 of file TkAlCaRecoMonitor.h.

Referenced by analyze(), and beginJob().

bool TkAlCaRecoMonitor::fillRawIdMap_
private

Definition at line 68 of file TkAlCaRecoMonitor.h.

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

MonitorElement* TkAlCaRecoMonitor::Hits_perDetId_
private

Definition at line 59 of file TkAlCaRecoMonitor.h.

Referenced by beginJob(), and fillHitmaps().

MonitorElement* TkAlCaRecoMonitor::Hits_XvsY_
private

Definition at line 65 of file TkAlCaRecoMonitor.h.

Referenced by beginJob(), and fillHitmaps().

MonitorElement* TkAlCaRecoMonitor::Hits_ZvsR_
private

Definition at line 64 of file TkAlCaRecoMonitor.h.

Referenced by beginJob(), and fillHitmaps().

MonitorElement* TkAlCaRecoMonitor::invariantMass_
private

Definition at line 52 of file TkAlCaRecoMonitor.h.

Referenced by analyze(), and beginJob().

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

Definition at line 74 of file TkAlCaRecoMonitor.h.

Referenced by analyze(), and TkAlCaRecoMonitor().

MonitorElement* TkAlCaRecoMonitor::jetPt_
private

Definition at line 55 of file TkAlCaRecoMonitor.h.

Referenced by analyze(), and beginJob().

double TkAlCaRecoMonitor::maxJetPt_
private

Definition at line 49 of file TkAlCaRecoMonitor.h.

Referenced by analyze(), and beginJob().

MonitorElement* TkAlCaRecoMonitor::minJetDeltaR_
private

Definition at line 56 of file TkAlCaRecoMonitor.h.

Referenced by analyze(), and beginJob().

MonitorElement* TkAlCaRecoMonitor::minTrackDeltaR_
private

Definition at line 57 of file TkAlCaRecoMonitor.h.

Referenced by analyze(), and beginJob().

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

Definition at line 73 of file TkAlCaRecoMonitor.h.

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

bool TkAlCaRecoMonitor::runsOnReco_
private

Definition at line 69 of file TkAlCaRecoMonitor.h.

Referenced by analyze(), and beginJob().

MonitorElement* TkAlCaRecoMonitor::sumCharge_
private

Definition at line 53 of file TkAlCaRecoMonitor.h.

Referenced by analyze(), and beginJob().

MonitorElement* TkAlCaRecoMonitor::TrackCurvature_
private

Definition at line 62 of file TkAlCaRecoMonitor.h.

Referenced by analyze(), and beginJob().

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

Definition at line 72 of file TkAlCaRecoMonitor.h.

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

MonitorElement* TkAlCaRecoMonitor::TrackPtNegative_
private

Definition at line 61 of file TkAlCaRecoMonitor.h.

Referenced by analyze(), and beginJob().

MonitorElement* TkAlCaRecoMonitor::TrackPtPositive_
private

Definition at line 60 of file TkAlCaRecoMonitor.h.

Referenced by analyze(), and beginJob().

MonitorElement* TkAlCaRecoMonitor::TrackQuality_
private

Definition at line 54 of file TkAlCaRecoMonitor.h.

Referenced by analyze(), and beginJob().

bool TkAlCaRecoMonitor::useSignedR_
private

Definition at line 70 of file TkAlCaRecoMonitor.h.

Referenced by beginJob(), and fillHitmaps().