CMS 3D CMS Logo

MuonTruth.h
Go to the documentation of this file.
1 #ifndef MCTruth_MuonTruth_h
2 #define MCTruth_MuonTruth_h
3 
24 
25 class MuonTruth {
26 public:
30  typedef std::pair<uint32_t, EncodedEventId> SimHitIdpr;
31 
34 
35  void initEvent(const edm::Event &, const edm::EventSetup &);
36 
37  void analyze(const CSCRecHit2D &recHit);
38  void analyze(const CSCStripDigi &stripDigi, int rawDetIdCorrespondingToCSCLayer);
39  void analyze(const CSCWireDigi &wireDigi, int rawDetIdCorrespondingToCSCLayer);
40 
42  float muonFraction();
43 
44  std::vector<PSimHit> muonHits();
45 
46  std::vector<PSimHit> simHits();
47 
49 
50 private:
51  std::vector<PSimHit> hitsFromSimTrack(SimHitIdpr truthId);
52  // goes to SimHits for information
53  int particleType(SimHitIdpr truthId);
54 
55  void addChannel(const LayerLinks &layerLinks, int channel, float weight = 1.);
56 
57  std::map<SimHitIdpr, float> theChargeMap;
59 
60  unsigned int theDetId;
61 
64 
67 
68  const bool crossingframe;
71 
74 
79 
80  std::map<unsigned int, edm::PSimHitContainer> theSimHitMap;
81 
83 };
84 
85 #endif
std::map< unsigned int, edm::PSimHitContainer > theSimHitMap
Definition: MuonTruth.h:80
std::pair< uint32_t, EncodedEventId > SimHitIdpr
Definition: MuonTruth.h:30
edm::DetSet< StripDigiSimLink > LayerLinks
Definition: MuonTruth.h:29
int particleType(SimHitIdpr truthId)
Definition: MuonTruth.cc:143
Definition: weight.py:1
const DigiSimLinks * theWireDigiSimLinks
Definition: MuonTruth.h:63
edm::EDGetTokenT< edm::PSimHitContainer > simHitsToken_
Definition: MuonTruth.h:78
const CSCGeometry * cscgeom
Definition: MuonTruth.h:82
std::map< SimHitIdpr, float > theChargeMap
Definition: MuonTruth.h:57
std::vector< PSimHit > muonHits()
Definition: MuonTruth.cc:113
const edm::ESGetToken< CSCGeometry, MuonGeometryRecord > geomToken_
Definition: MuonTruth.h:72
std::vector< PSimHit > simHits()
Definition: MuonTruth.cc:101
const CSCBadChambers * cscBadChambers
Definition: MuonTruth.h:48
unsigned int theDetId
Definition: MuonTruth.h:60
std::vector< PSimHit > hitsFromSimTrack(SimHitIdpr truthId)
Definition: MuonTruth.cc:126
const edm::InputTag wireLinksTag
Definition: MuonTruth.h:66
const edm::EDGetTokenT< DigiSimLinks > wireLinksToken_
Definition: MuonTruth.h:76
edm::DetSetVector< StripDigiSimLink > WireDigiSimLinks
Definition: MuonTruth.h:28
const edm::InputTag CSCsimHitsXFTag
Definition: MuonTruth.h:70
const edm::InputTag linksTag
Definition: MuonTruth.h:65
void analyze(const CSCRecHit2D &recHit)
Definition: MuonTruth.cc:152
float theTotalCharge
Definition: MuonTruth.h:58
const edm::InputTag CSCsimHitsTag
Definition: MuonTruth.h:69
MuonTruth(const edm::Event &, const edm::EventSetup &, const edm::ParameterSet &, edm::ConsumesCollector &)
Definition: MuonTruth.cc:7
const edm::EDGetTokenT< DigiSimLinks > linksToken_
Definition: MuonTruth.h:75
edm::EDGetTokenT< CrossingFrame< PSimHit > > simHitsXFToken_
Definition: MuonTruth.h:77
edm::DetSetVector< StripDigiSimLink > DigiSimLinks
Definition: MuonTruth.h:27
float muonFraction()
analyze() must be called before any of the following
Definition: MuonTruth.cc:85
const DigiSimLinks * theDigiSimLinks
Definition: MuonTruth.h:62
const bool crossingframe
Definition: MuonTruth.h:68
void addChannel(const LayerLinks &layerLinks, int channel, float weight=1.)
Definition: MuonTruth.cc:202
const edm::ESGetToken< CSCBadChambers, CSCBadChambersRcd > badToken_
Definition: MuonTruth.h:73
void initEvent(const edm::Event &, const edm::EventSetup &)
Definition: MuonTruth.cc:44