8 : cscBadChambers(nullptr),
11 theDigiSimLinks(nullptr),
12 theWireDigiSimLinks(nullptr),
13 linksTag(conf.getParameter<
edm::
InputTag>(
"CSClinksTag")),
14 wireLinksTag(conf.getParameter<
edm::
InputTag>(
"CSCwireLinksTag")),
22 wireLinksToken_(iC.consumes<
DigiSimLinks>(wireLinksTag)),
36 LogTrace(
"MuonTruth") <<
"getting CSC Strip DigiSimLink collection - " <<
linksTag;
59 LogTrace(
"MuonTruth") <<
"... size = " << CSCsimhits->size();
68 LogTrace(
"MuonTruth") <<
"... size = " << CSCsimhits->size();
70 for (edm::PSimHitContainer::const_iterator hitItr = CSCsimhits->begin(); hitItr != CSCsimhits->end(); ++hitItr) {
80 float muonCharge = 0.;
81 for (std::map<SimHitIdpr, float>::const_iterator chargeMapItr =
theChargeMap.begin();
85 muonCharge += chargeMapItr->second;
93 std::vector<PSimHit>
result;
94 for (std::map<SimHitIdpr, float>::const_iterator chargeMapItr =
theChargeMap.begin();
98 result.insert(
result.end(), trackHits.begin(), trackHits.end());
105 std::vector<PSimHit>
result;
106 std::vector<PSimHit> allHits =
simHits();
107 std::vector<PSimHit>::const_iterator hitItr = allHits.begin(), lastHit = allHits.end();
109 for (; hitItr != lastHit; ++hitItr) {
110 if (
abs((*hitItr).particleType()) == 13) {
111 result.push_back(*hitItr);
118 std::vector<PSimHit>
result;
122 for (
auto const &
hit :
found->second) {
123 unsigned int hitTrack =
hit.trackId();
126 if (hitTrack == truthId.first && hitEvId == truthId.second) {
148 int nchannels =
recHit.nStrips();
151 for (
int idigi = 0; idigi < nchannels; ++idigi) {
153 int istrip =
recHit.channels(idigi);
154 int channel = laygeom->
channel(istrip);
167 theDetId = rawDetIdCorrespondingToCSCLayer;
178 theDetId = rawDetIdCorrespondingToCSCLayer;
187 int wireDigiInSimulation = wireDigi.
getWireGroup() + 100;
189 addChannel(*layerLinks, wireDigiInSimulation, 1.);
196 for (; linkItr != lastLayerLink; ++linkItr) {
197 int linkChannel = linkItr->channel();
198 if (linkChannel == channel) {
202 SimHitIdpr truthId(linkItr->SimTrackId(), linkItr->eventId());
203 std::map<SimHitIdpr, float>::const_iterator chargeMapItr =
theChargeMap.find(truthId);
std::map< unsigned int, edm::PSimHitContainer > theSimHitMap
std::pair< uint32_t, EncodedEventId > SimHitIdpr
iterator find(det_id_type id)
int particleType(SimHitIdpr truthId)
T const * product() const
const DigiSimLinks * theWireDigiSimLinks
edm::EDGetTokenT< edm::PSimHitContainer > simHitsToken_
const CSCGeometry * cscgeom
std::map< SimHitIdpr, float > theChargeMap
std::vector< PSimHit > muonHits()
const edm::ESGetToken< CSCGeometry, MuonGeometryRecord > geomToken_
int channel(int strip) const
std::vector< PSimHit > simHits()
T const * product() const
const CSCBadChambers * cscBadChambers
std::vector< PSimHit > hitsFromSimTrack(SimHitIdpr truthId)
const edm::InputTag wireLinksTag
MuonTruth(const edm::ParameterSet &, edm::ConsumesCollector &&iC)
Abs< T >::type abs(const T &t)
const edm::EDGetTokenT< DigiSimLinks > wireLinksToken_
const edm::InputTag CSCsimHitsXFTag
const edm::InputTag linksTag
void analyze(const CSCRecHit2D &recHit)
iterator end()
Return the off-the-end iterator.
const edm::InputTag CSCsimHitsTag
const edm::EDGetTokenT< DigiSimLinks > linksToken_
edm::EDGetTokenT< CrossingFrame< PSimHit > > simHitsXFToken_
std::vector< PSimHit > PSimHitContainer
float muonFraction()
analyze() must be called before any of the following
const DigiSimLinks * theDigiSimLinks
collection_type::const_iterator const_iterator
collection_type::const_iterator const_iterator
const CSCLayer * layer(CSCDetId id) const
Return the layer corresponding to given DetId.
void addChannel(const LayerLinks &layerLinks, int channel, float weight=1.)
const edm::ESGetToken< CSCBadChambers, CSCBadChambersRcd > badToken_
int getWireGroup() const
default
void initEvent(const edm::Event &, const edm::EventSetup &)