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 
33 
34  void initEvent(const edm::Event &, const edm::EventSetup &);
35 
36  void analyze(const CSCRecHit2D &recHit);
37  void analyze(const CSCStripDigi &stripDigi, int rawDetIdCorrespondingToCSCLayer);
38  void analyze(const CSCWireDigi &wireDigi, int rawDetIdCorrespondingToCSCLayer);
39 
41  float muonFraction();
42 
43  std::vector<PSimHit> muonHits();
44 
45  std::vector<PSimHit> simHits();
46 
48 
49 private:
50  std::vector<PSimHit> hitsFromSimTrack(SimHitIdpr truthId);
51  // goes to SimHits for information
52  int particleType(SimHitIdpr truthId);
53 
54  void addChannel(const LayerLinks &layerLinks, int channel, float weight = 1.);
55 
56  std::map<SimHitIdpr, float> theChargeMap;
58 
59  unsigned int theDetId;
60 
63 
66 
67  const bool crossingframe;
70 
73 
78 
79  std::map<unsigned int, edm::PSimHitContainer> theSimHitMap;
80 
82 };
83 
84 #endif
std::map< unsigned int, edm::PSimHitContainer > theSimHitMap
Definition: MuonTruth.h:79
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:134
Definition: weight.py:1
const DigiSimLinks * theWireDigiSimLinks
Definition: MuonTruth.h:62
edm::EDGetTokenT< edm::PSimHitContainer > simHitsToken_
Definition: MuonTruth.h:77
const CSCGeometry * cscgeom
Definition: MuonTruth.h:81
std::map< SimHitIdpr, float > theChargeMap
Definition: MuonTruth.h:56
std::vector< PSimHit > muonHits()
Definition: MuonTruth.cc:104
const edm::ESGetToken< CSCGeometry, MuonGeometryRecord > geomToken_
Definition: MuonTruth.h:71
std::vector< PSimHit > simHits()
Definition: MuonTruth.cc:92
const CSCBadChambers * cscBadChambers
Definition: MuonTruth.h:47
unsigned int theDetId
Definition: MuonTruth.h:59
std::vector< PSimHit > hitsFromSimTrack(SimHitIdpr truthId)
Definition: MuonTruth.cc:117
const edm::InputTag wireLinksTag
Definition: MuonTruth.h:65
MuonTruth(const edm::ParameterSet &, edm::ConsumesCollector &&iC)
Definition: MuonTruth.cc:7
const edm::EDGetTokenT< DigiSimLinks > wireLinksToken_
Definition: MuonTruth.h:75
edm::DetSetVector< StripDigiSimLink > WireDigiSimLinks
Definition: MuonTruth.h:28
const edm::InputTag CSCsimHitsXFTag
Definition: MuonTruth.h:69
const edm::InputTag linksTag
Definition: MuonTruth.h:64
void analyze(const CSCRecHit2D &recHit)
Definition: MuonTruth.cc:143
float theTotalCharge
Definition: MuonTruth.h:57
const edm::InputTag CSCsimHitsTag
Definition: MuonTruth.h:68
const edm::EDGetTokenT< DigiSimLinks > linksToken_
Definition: MuonTruth.h:74
edm::EDGetTokenT< CrossingFrame< PSimHit > > simHitsXFToken_
Definition: MuonTruth.h:76
edm::DetSetVector< StripDigiSimLink > DigiSimLinks
Definition: MuonTruth.h:27
float muonFraction()
analyze() must be called before any of the following
Definition: MuonTruth.cc:76
const DigiSimLinks * theDigiSimLinks
Definition: MuonTruth.h:61
const bool crossingframe
Definition: MuonTruth.h:67
void addChannel(const LayerLinks &layerLinks, int channel, float weight=1.)
Definition: MuonTruth.cc:193
const edm::ESGetToken< CSCBadChambers, CSCBadChambersRcd > badToken_
Definition: MuonTruth.h:72
void initEvent(const edm::Event &, const edm::EventSetup &)
Definition: MuonTruth.cc:31