CMS 3D CMS Logo

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

#include <MuonTrackResidualAnalyzer.h>

Inheritance diagram for MuonTrackResidualAnalyzer:
edm::EDAnalyzer

Classes

struct  RadiusComparatorInOut
 

Public Types

enum  EtaRange { all, barrel, endcap }
 
- Public Types inherited from edm::EDAnalyzer
typedef EDAnalyzer ModuleType
 
typedef WorkerT< EDAnalyzerWorkerType
 

Public Member Functions

void analyze (const edm::Event &event, const edm::EventSetup &eventSetup)
 
virtual void beginJob ()
 
virtual void endJob ()
 
 MuonTrackResidualAnalyzer (const edm::ParameterSet &pset)
 Constructor. More...
 
virtual ~MuonTrackResidualAnalyzer ()
 Destructor. More...
 
- Public Member Functions inherited from edm::EDAnalyzer
 EDAnalyzer ()
 
std::string workerType () const
 
virtual ~EDAnalyzer ()
 

Private Member Functions

void computeResolution (Trajectory &trajectory, std::map< DetId, const PSimHit * > &hitIdMap, HResolution1DRecHit *histos)
 
bool isInTheAcceptance (double eta)
 
std::map< DetId, const PSimHit * > mapMuSimHitsPerId (edm::Handle< edm::PSimHitContainer > dtSimhits, edm::Handle< edm::PSimHitContainer > cscSimhits, edm::Handle< edm::PSimHitContainer > rpcSimhits)
 
void mapMuSimHitsPerId (edm::Handle< edm::PSimHitContainer > simhits, std::map< DetId, const PSimHit * > &hitIdMap)
 

Private Attributes

edm::InputTag cscSimHitLabel
 
DQMStoredbe_
 
std::string dirName_
 
edm::InputTag dtSimHitLabel
 
HResolution1DRecHith1DRecHitRes
 
HResolution1DRecHith1DSimHitRes
 
MonitorElementhDeltaPtVsEtaSim
 
MonitorElementhDeltaPtVsEtaSim2
 
MonitorElementhDPtRef
 
MonitorElementhSimHitsPerTrack
 
MonitorElementhSimHitsPerTrackVsEta
 
std::string out
 
edm::InputTag rpcSimHitLabel
 
edm::InputTag theDataType
 
MeasurementEstimatortheEstimator
 
EtaRange theEtaRange
 
int theMuonSimHitNumberPerEvent
 
edm::InputTag theMuonTrackLabel
 
edm::InputTag theSeedCollectionLabel
 
MuonServiceProxytheService
 
std::vector< const PSimHit * > theSimHitContainer
 
unsigned int theSimTkId
 
KFUpdatortheUpdator
 

Additional Inherited Members

- 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::EDAnalyzer
CurrentProcessingContext const * currentContext () const
 

Detailed Description

No description available.

Date:
2010/02/20 21:02:36
Revision:
1.7
Author
R. Bellan - INFN Torino ricca.nosp@m.rdo..nosp@m.bella.nosp@m.n@ce.nosp@m.rn.ch

Definition at line 44 of file MuonTrackResidualAnalyzer.h.

Member Enumeration Documentation

Constructor & Destructor Documentation

MuonTrackResidualAnalyzer::MuonTrackResidualAnalyzer ( const edm::ParameterSet pset)

Constructor.

Definition at line 38 of file MuonTrackResidualAnalyzer.cc.

References Chi2MeasurementEstimatorESProducer_cfi::Chi2MeasurementEstimator, dbe_, edm::ParameterSet::getParameter(), edm::ParameterSet::getUntrackedParameter(), LogDebug, MuonServiceProxy_cff::MuonServiceProxy, cppFunctionSkipper::operator, and dbtoconf::out.

38  {
39 
40  // service parameters
41  ParameterSet serviceParameters = pset.getParameter<ParameterSet>("ServiceParameters");
42  // the services
43  theService = new MuonServiceProxy(serviceParameters);
44 
45  theMuonTrackLabel = pset.getParameter<InputTag>("MuonTrack");
46  theSeedCollectionLabel = pset.getParameter<InputTag>("MuonSeed");
47 
48  cscSimHitLabel = pset.getParameter<InputTag>("CSCSimHit");
49  dtSimHitLabel = pset.getParameter<InputTag>("DTSimHit");
50  rpcSimHitLabel = pset.getParameter<InputTag>("RPCSimHit");
51 
53  out = pset.getUntrackedParameter<string>("rootFileName");
54  dirName_ = pset.getUntrackedParameter<std::string>("dirName");
55 
56  // Sim or Real
57  theDataType = pset.getParameter<InputTag>("DataType");
58  if(theDataType.label() != "RealData" && theDataType.label() != "SimData")
59  LogDebug("MuonTrackResidualAnalyzer")<<"Error in Data Type!!";
60 
61  theEtaRange = (EtaRange) pset.getParameter<int>("EtaRange");
62 
63  theUpdator = new KFUpdator();
65 
67 }
#define LogDebug(id)
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
MeasurementEstimator * theEstimator
std::string const & label() const
Definition: InputTag.h:25
MuonTrackResidualAnalyzer::~MuonTrackResidualAnalyzer ( )
virtual

Destructor.

Definition at line 70 of file MuonTrackResidualAnalyzer.cc.

70  {
71  delete theUpdator;
72  delete theEstimator;
73  delete theService;
74 }
MeasurementEstimator * theEstimator

Member Function Documentation

void MuonTrackResidualAnalyzer::analyze ( const edm::Event event,
const edm::EventSetup eventSetup 
)
virtual

Implements edm::EDAnalyzer.

Definition at line 117 of file MuonTrackResidualAnalyzer.cc.

References abs, debug, LogDebug, LogTrace, mag(), query::result, and GeomDet::toGlobal().

117  {
118  LogDebug("MuonTrackResidualAnalyzer")<<"Analyze";
119 
120  // Update the services
121  theService->update(eventSetup);
124 
125  // Get the SimHit collection from the event
126  Handle<PSimHitContainer> dtSimHits;
127  event.getByLabel(dtSimHitLabel.instance(),dtSimHitLabel.label(), dtSimHits);
128 
129  Handle<PSimHitContainer> cscSimHits;
130  event.getByLabel(cscSimHitLabel.instance(),cscSimHitLabel.label(), cscSimHits);
131 
132  Handle<PSimHitContainer> rpcSimHits;
133  event.getByLabel(rpcSimHitLabel.instance(),rpcSimHitLabel.label(), rpcSimHits);
134 
135  Handle<SimTrackContainer> simTracks;
136 
137  // FIXME Add the tracker one??
138 
139  // Map simhits per DetId
140  map<DetId, const PSimHit* > muonSimHitsPerId =
141  mapMuSimHitsPerId(dtSimHits,cscSimHits,rpcSimHits);
142 
144 
145  double etaSim=0;
146 
147  if(theDataType.label() == "SimData"){
148 
149  // Get the SimTrack collection from the event
150  event.getByLabel(theDataType.instance(),simTracks);
151 
152  // Loop over the Sim tracks
153  SimTrackContainer::const_iterator simTrack;
154 
155  for (simTrack = simTracks->begin(); simTrack != simTracks->end(); ++simTrack)
156  if (abs((*simTrack).type()) == 13){
157  hSimHitsPerTrackVsEta->Fill((*simTrack).momentum().eta(),theMuonSimHitNumberPerEvent);
158  etaSim = (*simTrack).momentum().eta();
159  theSimTkId = (*simTrack).trackId();
160 
161  }
162  }
163 
164 
165  // Get the RecTrack collection from the event
167  event.getByLabel(theMuonTrackLabel, muonTracks);
168 
169  reco::TrackCollection::const_iterator muonTrack;
170 
171  // Loop over the Rec tracks
172  for (muonTrack = muonTracks->begin(); muonTrack != muonTracks->end(); ++muonTrack) {
173 
174  reco::TransientTrack track(*muonTrack,&*theService->magneticField(),theService->trackingGeometry());
175 
176  TrajectoryStateOnSurface outerTSOS = track.outermostMeasurementState();
177  TrajectoryStateOnSurface innerTSOS = track.innermostMeasurementState();
178 
180 
181  // SimHit Energy loss analysis
182  double momAtEntry = -150., momAtExit = -150.;
183 
184  if(theSimHitContainer.size()>1){
185 
186  const GeomDet *geomDetA = theService->trackingGeometry()->idToDet(DetId(theSimHitContainer.front()->detUnitId()));
187  double distA = geomDetA->toGlobal(theSimHitContainer.front()->localPosition()).mag();
188 
189  const GeomDet *geomDetB = theService->trackingGeometry()->idToDet(DetId(theSimHitContainer.back()->detUnitId()));
190  double distB = geomDetB->toGlobal(theSimHitContainer.back()->localPosition()).mag();
191 
192  LogTrace("MuonTrackResidualAnalyzer")<<"Inner SimHit: "<<theSimHitContainer.front()->particleType()
193  <<" Pt: "<<theSimHitContainer.front()->momentumAtEntry().perp()
194  <<" E: "<<theSimHitContainer.front()->momentumAtEntry().perp()
195  <<" R: "<<distA<<endl;
196  LogTrace("MuonTrackResidualAnalyzer")<<"Outer SimHit: "<<theSimHitContainer.back()->particleType()
197  <<" Pt: "<<theSimHitContainer.back()->momentumAtEntry().perp()
198  <<" E: "<<theSimHitContainer.front()->momentumAtEntry().perp()
199  <<" R: "<<distB<<endl;
200 
201  momAtEntry = theSimHitContainer.front()->momentumAtEntry().perp();
202  momAtExit = theSimHitContainer.back()->momentumAtEntry().perp();
203  }
204 
205  trackingRecHit_iterator rhFirst = track.recHitsBegin();
206  trackingRecHit_iterator rhLast = track.recHitsEnd()-1;
207  map<DetId,const PSimHit*>::const_iterator itFirst = muonSimHitsPerId.find((*rhFirst)->geographicalId());
208  map<DetId,const PSimHit*>::const_iterator itLast = muonSimHitsPerId.find((*rhLast)->geographicalId());
209 
210  double momAtEntry2 = -150, momAtExit2 = -150.;
211  if (itFirst != muonSimHitsPerId.end() )
212  momAtEntry2 = itFirst->second->momentumAtEntry().perp();
213  else {
214  LogDebug("MuonTrackResidualAnalyzer")<<"No first sim hit found";
215  ++rhFirst;
216  itFirst = muonSimHitsPerId.find((*rhFirst)->geographicalId());
217  if (itFirst != muonSimHitsPerId.end() )
218  momAtEntry2 = itFirst->second->momentumAtEntry().perp();
219  else{
220  LogDebug("MuonTrackResidualAnalyzer")<<"No second sim hit found";
221  // continue;
222  }
223  }
224 
225  if (itLast != muonSimHitsPerId.end() )
226  momAtExit2 = itLast->second->momentumAtEntry().perp();
227  else {
228  LogDebug("MuonTrackResidualAnalyzer")<<"No last sim hit found";
229  --rhLast;
230  itLast = muonSimHitsPerId.find((*rhLast)->geographicalId());
231  if (itLast != muonSimHitsPerId.end() )
232  momAtExit2 = itLast->second->momentumAtEntry().perp();
233  else{
234  LogDebug("MuonTrackResidualAnalyzer")<<"No last but one sim hit found";
235  // continue;
236  }
237  }
238 
239  if(etaSim){
240  if(momAtEntry >=0 && momAtExit >= 0)
241  hDeltaPtVsEtaSim->Fill(etaSim,momAtEntry-momAtExit);
242  if(momAtEntry2 >=0 && momAtExit2 >= 0)
243  hDeltaPtVsEtaSim2->Fill(etaSim,momAtEntry2-momAtExit2);
244  }
245  else
246  LogDebug("MuonTrackResidualAnalyzer")<<"NO SimTrack'eta";
247  //
248 
249  // computeResolution(trajectoryBW,muonSimHitsPerId,h1DSimHitRes);
250  // computeResolution(smoothed,muonSimHitsPerId,h1DSimHitRes);
251 
252  }
253 }
#define LogDebug(id)
std::map< DetId, const PSimHit * > mapMuSimHitsPerId(edm::Handle< edm::PSimHitContainer > dtSimhits, edm::Handle< edm::PSimHitContainer > cscSimhits, edm::Handle< edm::PSimHitContainer > rpcSimhits)
T mag() const
The vector magnitude. Equivalent to sqrt(vec.mag2())
GlobalPoint toGlobal(const Local2DPoint &lp) const
Conversion to the global R.F. from the R.F. of the GeomDet.
Definition: GeomDet.h:47
#define abs(x)
Definition: mlp_lapack.h:159
void Fill(long long x)
tuple result
Definition: query.py:137
#define LogTrace(id)
std::vector< ConstRecHitPointer > ConstRecHitContainer
Definition: DetId.h:20
std::vector< const PSimHit * > theSimHitContainer
std::string const & label() const
Definition: InputTag.h:25
#define debug
Definition: MEtoEDMFormat.h:34
std::string const & instance() const
Definition: InputTag.h:26
void MuonTrackResidualAnalyzer::beginJob ( void  )
virtual

Reimplemented from edm::EDAnalyzer.

Definition at line 77 of file MuonTrackResidualAnalyzer.cc.

References algo, DQMStore::book1D(), DQMStore::book2D(), DQMStore::cd(), dbe_, TrackerOfflineValidation_Dqm_cff::dirName, edm::InputTag::instance(), edm::InputTag::label(), LogDebug, edm::InputTag::process(), linker::replace(), DQMStore::setCurrentFolder(), and DQMStore::showDirStructure().

77  {
78  LogDebug("MuonTrackResidualAnalyzer")<<"Begin Job";
79 
81 
82  dbe_->cd();
84  string dirName=dirName_;
85  if (algo.process()!="")
86  dirName+=algo.process()+"_";
87  if(algo.label()!="")
88  dirName+=algo.label()+"_";
89  if(algo.instance()!="")
90  dirName+=algo.instance()+"";
91  if (dirName.find("Tracks")<dirName.length()){
92  dirName.replace(dirName.find("Tracks"),6,"");
93  }
94  std::replace(dirName.begin(), dirName.end(), ':', '_');
95  dbe_->setCurrentFolder(dirName.c_str());
96 
97 
98  hDPtRef = dbe_->book1D("DeltaPtRef","P^{in}_{t}-P^{in ref}",10000,-20,20);
99 
100  // Resolution wrt the 1D Rec Hits
101  // h1DRecHitRes = new HResolution1DRecHit("TotalRec");
102 
103  // Resolution wrt the 1d Sim Hits
104  // h1DSimHitRes = new HResolution1DRecHit("TotalSim");
105 
106  hSimHitsPerTrack = dbe_->book1D("SimHitsPerTrack","Number of sim hits per track",55,0,55);
107  hSimHitsPerTrackVsEta = dbe_->book2D("SimHitsPerTrackVsEta","Number of sim hits per track VS #eta",120,-3.,3.,55,0,55);
108  hDeltaPtVsEtaSim = dbe_->book2D("DeltaPtVsEtaSim","#Delta P_{t} vs #eta gen, sim quantity",120,-3.,3.,500,-250.,250.);
109  hDeltaPtVsEtaSim2 = dbe_->book2D("DeltaPtVsEtaSim2","#Delta P_{t} vs #eta gen, sim quantity",120,-3.,3.,500,-250.,250.);
110 }
#define LogDebug(id)
MonitorElement * book1D(const char *name, const char *title, int nchX, double lowX, double highX)
Book 1D histogram.
Definition: DQMStore.cc:717
void cd(void)
go to top directory (ie. root)
Definition: DQMStore.cc:406
def replace
Definition: linker.py:10
std::string const & label() const
Definition: InputTag.h:25
std::string const & process() const
Definition: InputTag.h:29
void showDirStructure(void) const
Definition: DQMStore.cc:2761
LimitAlgo * algo
Definition: Combine.cc:60
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:845
std::string const & instance() const
Definition: InputTag.h:26
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:429
void MuonTrackResidualAnalyzer::computeResolution ( Trajectory trajectory,
std::map< DetId, const PSimHit * > &  hitIdMap,
HResolution1DRecHit histos 
)
private

Definition at line 329 of file MuonTrackResidualAnalyzer.cc.

References abs, gather_cfg::cout, data, PSimHit::detUnitId(), diffTreeTool::diff, PV3DBase< T, PVType, FrameType >::eta(), HResolution1DRecHit::Fill(), PSimHit::localPosition(), Trajectory::measurements(), PSimHit::momentumAtEntry(), PV3DBase< T, PVType, FrameType >::phi(), GeomDet::toLocal(), PV3DBase< T, PVType, FrameType >::x(), PV3DBase< T, PVType, FrameType >::y(), and PV3DBase< T, PVType, FrameType >::z().

331  {
332 
334 
335  for(Trajectory::DataContainer::const_iterator datum = data.begin();
336  datum != data.end(); ++datum){
337 
338  GlobalPoint fitPoint = datum->updatedState().globalPosition();
339 
340  // FIXME!
341  // double errX = datum->updatedState().cartesianError().matrix()[0][0];
342  // double errY = datum->updatedState().cartesianError().matrix()[1][1];
343  // double errZ = datum->updatedState().cartesianError().matrix()[2][2];
344  //
345  double errX = datum->updatedState().localError().matrix()(3,3);
346  double errY = datum->updatedState().localError().matrix()(4,4);
347  double errZ = 1.;
348 
349  map<DetId,const PSimHit*>::const_iterator it = hitIdMap.find(datum->recHit()->geographicalId());
350 
351 
352  if (it == hitIdMap.end() ) continue; // FIXME! Put a counter
353 
354  const PSimHit* simhit = it->second;
355 
356  LocalPoint simHitPoint = simhit->localPosition();
357 
358  const GeomDet* geomDet = theService->trackingGeometry()->idToDet(DetId(simhit->detUnitId()));
359 
360  LocalPoint fitLocalPoint = geomDet->toLocal(fitPoint);
361 
362  LocalVector diff = fitLocalPoint-simHitPoint;
363 
364 
365  cout << "SimHit position "<< simHitPoint << endl;
366  cout << "Fit position "<< fitLocalPoint << endl;
367  cout << "Fit position2 "<< datum->updatedState().localPosition() << endl;
368  cout << "Errors on the fit position: (" << errX << "," << errY << "," << errZ << ")"<<endl;
369  cout << "Resolution on x: " << diff.x()/abs(simHitPoint.x()) << endl;
370  cout << "Resolution on y: " << diff.y()/abs(simHitPoint.y()) << endl;
371  cout << "Resolution on z: " << diff.z()/abs(simHitPoint.z()) << endl;
372 
373  cout << "Eta direction: "<< simhit->momentumAtEntry().eta() <<" eta position: " << simHitPoint.eta() << endl;
374  cout << "Phi direction: "<< simhit->momentumAtEntry().phi() <<" phi position: " << simHitPoint.phi() << endl;
375 
376 
377  histos->Fill( simHitPoint.x(), simHitPoint.y(), simHitPoint.z(),
378  diff.x(), diff.y(), diff.z(),
379  errX, errY, errZ,
380  simhit->momentumAtEntry().eta(), simhit->momentumAtEntry().phi());
381  // simHitPoint.eta(), simHitPoint.phi() ); // FIXME!
382  }
383 
384 
385 }
LocalVector momentumAtEntry() const
The momentum of the track that produced the hit, at entry point.
Definition: PSimHit.h:47
Geom::Phi< T > phi() const
Definition: PV3DBase.h:68
T y() const
Definition: PV3DBase.h:62
#define abs(x)
Definition: mlp_lapack.h:159
LocalPoint toLocal(const GlobalPoint &gp) const
Conversion to the R.F. of the GeomDet.
Definition: GeomDet.h:62
DataContainer const & measurements() const
Definition: Trajectory.h:203
std::vector< TrajectoryMeasurement > DataContainer
Definition: Trajectory.h:42
Local3DPoint localPosition() const
Definition: PSimHit.h:44
T z() const
Definition: PV3DBase.h:63
Definition: DetId.h:20
T eta() const
Definition: PV3DBase.h:75
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:82
tuple cout
Definition: gather_cfg.py:121
void Fill(double x, double y, double z, double dx, double dy, double dz, double errx, double erry, double errz, double eta, double phi)
Definition: Histograms.h:340
T x() const
Definition: PV3DBase.h:61
unsigned int detUnitId() const
Definition: PSimHit.h:93
void MuonTrackResidualAnalyzer::endJob ( void  )
virtual

Reimplemented from edm::EDAnalyzer.

Definition at line 112 of file MuonTrackResidualAnalyzer.cc.

References dbe_, dbtoconf::out, and DQMStore::save().

112  {
113  if ( out.size() != 0 && dbe_ ) dbe_->save(out);
114 }
void save(const std::string &filename, const std::string &path="", const std::string &pattern="", const std::string &rewrite="", SaveReferenceTag ref=SaveWithReference, int minStatus=dqm::qstatus::STATUS_OK, const std::string &fileupdate="RECREATE")
Definition: DQMStore.cc:2113
bool MuonTrackResidualAnalyzer::isInTheAcceptance ( double  eta)
private

Definition at line 255 of file MuonTrackResidualAnalyzer.cc.

References abs, cond::ecalcond::all, Reference_intrackfit_cff::barrel, Reference_intrackfit_cff::endcap, and LogDebug.

255  {
256  switch(theEtaRange){
257  case all:
258  return ( abs(eta) <= 2.4 ) ? true : false;
259  case barrel:
260  return ( abs(eta) < 1.1 ) ? true : false;
261  case endcap:
262  return ( abs(eta) >= 1.1 && abs(eta) <= 2.4 ) ? true : false;
263  default:
264  {LogDebug("MuonTrackResidualAnalyzer")<<"No correct Eta range selected!! "; return false;}
265  }
266 }
#define LogDebug(id)
#define abs(x)
Definition: mlp_lapack.h:159
T eta() const
map< DetId, const PSimHit * > MuonTrackResidualAnalyzer::mapMuSimHitsPerId ( edm::Handle< edm::PSimHitContainer dtSimhits,
edm::Handle< edm::PSimHitContainer cscSimhits,
edm::Handle< edm::PSimHitContainer rpcSimhits 
)
private

Definition at line 270 of file MuonTrackResidualAnalyzer.cc.

References prof2calltree::count, debug, MuonPatternRecoDumper::dumpMuonId(), LogDebug, and LogTrace.

272  {
273 
275 
276  map<DetId,const PSimHit*> hitIdMap;
277  theSimHitContainer.clear();
278 
279  mapMuSimHitsPerId(dtSimhits,hitIdMap);
280  mapMuSimHitsPerId(cscSimhits,hitIdMap);
281  mapMuSimHitsPerId(rpcSimhits,hitIdMap);
282 
283  if(theSimHitContainer.size() >1)
284  stable_sort(theSimHitContainer.begin(),theSimHitContainer.end(),RadiusComparatorInOut(theService->trackingGeometry()));
285 
286  LogDebug("MuonTrackResidualAnalyzer")<<"Sim Hit list";
287  int count=1;
288  for(vector<const PSimHit*>::const_iterator it = theSimHitContainer.begin();
289  it != theSimHitContainer.end(); ++it){
290  LogTrace("MuonTrackResidualAnalyzer")<<count
291  << " "
292  << " Process Type: " << (*it)->processType()
293  << " "
294  << debug.dumpMuonId(DetId( (*it)->detUnitId() ))<<endl;
295  }
296 
297  return hitIdMap;
298 }
#define LogDebug(id)
std::map< DetId, const PSimHit * > mapMuSimHitsPerId(edm::Handle< edm::PSimHitContainer > dtSimhits, edm::Handle< edm::PSimHitContainer > cscSimhits, edm::Handle< edm::PSimHitContainer > rpcSimhits)
std::string dumpMuonId(const DetId &id) const
#define LogTrace(id)
Definition: DetId.h:20
std::vector< const PSimHit * > theSimHitContainer
#define debug
Definition: MEtoEDMFormat.h:34
void MuonTrackResidualAnalyzer::mapMuSimHitsPerId ( edm::Handle< edm::PSimHitContainer simhits,
std::map< DetId, const PSimHit * > &  hitIdMap 
)
private

Definition at line 301 of file MuonTrackResidualAnalyzer.cc.

References abs, MuonSubdetId::DT, LogDebug, and DetId::rawId().

302  {
303 
304  for(PSimHitContainer::const_iterator simhit = simhits->begin();
305  simhit != simhits->end(); ++simhit) {
306 
307  if ( abs(simhit->particleType()) != 13 && theSimTkId != simhit->trackId()) continue;
308 
309  theSimHitContainer.push_back(&*simhit);
310  DetId id = DetId(simhit->detUnitId());
311 
312  if(id.subdetId() == MuonSubdetId::DT){
313  DTLayerId lId(id.rawId());
314  id = DetId(lId.rawId());
315  }
316 
317  map<DetId,const PSimHit*>::const_iterator it = hitIdMap.find(id);
318 
319  if (it == hitIdMap.end() )
320  hitIdMap[id] = &*simhit;
321  else
322  LogDebug("MuonTrackResidualAnalyzer")<<"TWO muons in the same sensible volume!!";
323 
325  }
326 }
#define LogDebug(id)
#define abs(x)
Definition: mlp_lapack.h:159
Definition: DetId.h:20
std::vector< const PSimHit * > theSimHitContainer
static const int DT
Definition: MuonSubdetId.h:14

Member Data Documentation

edm::InputTag MuonTrackResidualAnalyzer::cscSimHitLabel
private

Definition at line 91 of file MuonTrackResidualAnalyzer.h.

DQMStore* MuonTrackResidualAnalyzer::dbe_
private

Definition at line 81 of file MuonTrackResidualAnalyzer.h.

std::string MuonTrackResidualAnalyzer::dirName_
private

Definition at line 82 of file MuonTrackResidualAnalyzer.h.

edm::InputTag MuonTrackResidualAnalyzer::dtSimHitLabel
private

Definition at line 92 of file MuonTrackResidualAnalyzer.h.

HResolution1DRecHit* MuonTrackResidualAnalyzer::h1DRecHitRes
private

Definition at line 103 of file MuonTrackResidualAnalyzer.h.

HResolution1DRecHit* MuonTrackResidualAnalyzer::h1DSimHitRes
private

Definition at line 106 of file MuonTrackResidualAnalyzer.h.

MonitorElement* MuonTrackResidualAnalyzer::hDeltaPtVsEtaSim
private

Definition at line 110 of file MuonTrackResidualAnalyzer.h.

MonitorElement* MuonTrackResidualAnalyzer::hDeltaPtVsEtaSim2
private

Definition at line 111 of file MuonTrackResidualAnalyzer.h.

MonitorElement* MuonTrackResidualAnalyzer::hDPtRef
private

Definition at line 100 of file MuonTrackResidualAnalyzer.h.

MonitorElement* MuonTrackResidualAnalyzer::hSimHitsPerTrack
private

Definition at line 108 of file MuonTrackResidualAnalyzer.h.

MonitorElement* MuonTrackResidualAnalyzer::hSimHitsPerTrackVsEta
private

Definition at line 109 of file MuonTrackResidualAnalyzer.h.

std::string MuonTrackResidualAnalyzer::out
private

Definition at line 84 of file MuonTrackResidualAnalyzer.h.

edm::InputTag MuonTrackResidualAnalyzer::rpcSimHitLabel
private

Definition at line 93 of file MuonTrackResidualAnalyzer.h.

edm::InputTag MuonTrackResidualAnalyzer::theDataType
private

Definition at line 86 of file MuonTrackResidualAnalyzer.h.

MeasurementEstimator* MuonTrackResidualAnalyzer::theEstimator
private

Definition at line 97 of file MuonTrackResidualAnalyzer.h.

EtaRange MuonTrackResidualAnalyzer::theEtaRange
private

Definition at line 87 of file MuonTrackResidualAnalyzer.h.

int MuonTrackResidualAnalyzer::theMuonSimHitNumberPerEvent
private

Definition at line 113 of file MuonTrackResidualAnalyzer.h.

edm::InputTag MuonTrackResidualAnalyzer::theMuonTrackLabel
private

Definition at line 89 of file MuonTrackResidualAnalyzer.h.

edm::InputTag MuonTrackResidualAnalyzer::theSeedCollectionLabel
private

Definition at line 90 of file MuonTrackResidualAnalyzer.h.

MuonServiceProxy* MuonTrackResidualAnalyzer::theService
private

Definition at line 95 of file MuonTrackResidualAnalyzer.h.

std::vector<const PSimHit*> MuonTrackResidualAnalyzer::theSimHitContainer
private

Definition at line 118 of file MuonTrackResidualAnalyzer.h.

unsigned int MuonTrackResidualAnalyzer::theSimTkId
private

Definition at line 115 of file MuonTrackResidualAnalyzer.h.

KFUpdator* MuonTrackResidualAnalyzer::theUpdator
private

Definition at line 96 of file MuonTrackResidualAnalyzer.h.