10 theWireDigiSimLinks(0),
11 linksTag(conf.getParameter<edm::
InputTag>(
"CSClinksTag")),
12 wireLinksTag(conf.getParameter<edm::
InputTag>(
"CSCwireLinksTag")),
14 crossingframe(conf.getParameter<bool>(
"crossingframe")),
15 CSCsimHitsTag(conf.getParameter<edm::
InputTag>(
"CSCsimHitsTag")),
16 CSCsimHitsXFTag(conf.getParameter<edm::
InputTag>(
"CSCsimHitsXFTag"))
24 theWireDigiSimLinks(0),
25 linksTag(conf.getParameter<edm::
InputTag>(
"CSClinksTag")),
26 wireLinksTag(conf.getParameter<edm::
InputTag>(
"CSCwireLinksTag")),
28 crossingframe(conf.getParameter<bool>(
"crossingframe")),
29 CSCsimHitsTag(conf.getParameter<edm::
InputTag>(
"CSCsimHitsTag")),
30 CSCsimHitsXFTag(conf.getParameter<edm::
InputTag>(
"CSCsimHitsXFTag"))
46 LogTrace(
"MuonTruth") <<
"getting CSC Strip DigiSimLink collection - "<<
linksTag;
47 event.getByLabel(
linksTag, digiSimLinks);
73 std::auto_ptr<MixCollection<PSimHit> >
75 LogTrace(
"MuonTruth") <<
"... size = "<<CSCsimhits->size();
78 hitItr != CSCsimhits->end(); ++hitItr)
88 LogTrace(
"MuonTruth") <<
"... size = "<<CSCsimhits->size();
90 for(edm::PSimHitContainer::const_iterator hitItr = CSCsimhits->begin();
91 hitItr != CSCsimhits->end(); ++hitItr)
102 float muonCharge = 0.;
103 for(std::map<SimHitIdpr, float>::const_iterator chargeMapItr =
theChargeMap.begin();
108 muonCharge += chargeMapItr->second;
118 std::vector<PSimHit>
result;
119 for(std::map<SimHitIdpr, float>::const_iterator chargeMapItr =
theChargeMap.begin();
123 result.insert(result.end(), trackHits.begin(), trackHits.end());
132 std::vector<PSimHit>
result;
133 std::vector<PSimHit> allHits =
simHits();
134 std::vector<PSimHit>::const_iterator hitItr = allHits.begin(), lastHit = allHits.end();
136 for( ; hitItr != lastHit; ++hitItr)
138 if(
abs((*hitItr).particleType()) == 13)
140 result.push_back(*hitItr);
150 std::vector<PSimHit>
result;
157 unsigned int hitTrack =
hit.trackId();
160 if(hitTrack == truthId.first && hitEvId == truthId.second)
162 result.push_back(
hit);
176 result = hits[0].particleType();
188 int nchannels = recHit.
nStrips();
191 for(
int idigi = 0; idigi < nchannels; ++idigi)
194 int istrip = recHit.
channels(idigi);
195 int channel = laygeom->
channel(istrip);
210 theDetId = rawDetIdCorrespondingToCSCLayer;
224 theDetId = rawDetIdCorrespondingToCSCLayer;
233 int wireDigiInSimulation = wireDigi.
getWireGroup() + 100;
235 addChannel(*layerLinks, wireDigiInSimulation, 1.);
243 lastLayerLink = layerLinks.
end();
245 for ( ; linkItr != lastLayerLink; ++linkItr)
247 int linkChannel = linkItr->channel();
248 if(linkChannel == channel)
253 SimHitIdpr truthId(linkItr->SimTrackId(),linkItr->eventId());
254 std::map<SimHitIdpr, float>::const_iterator chargeMapItr =
theChargeMap.find(truthId);
std::map< unsigned int, edm::PSimHitContainer > theSimHitMap
std::pair< uint32_t, EncodedEventId > SimHitIdpr
edm::InputTag CSCsimHitsTag
CSCDetId cscDetId() const
iterator find(det_id_type id)
int particleType(SimHitIdpr truthId)
edm::InputTag CSCsimHitsXFTag
edm::InputTag wireLinksTag
const DigiSimLinks * theWireDigiSimLinks
const CSCGeometry * cscgeom
std::map< SimHitIdpr, float > theChargeMap
std::vector< PSimHit > muonHits()
std::vector< PSimHit > simHits()
uint32_t rawId() const
get the raw id
int channels(unsigned int i) const
Extracting strip channel numbers comprising the rechit - low.
const CSCBadChambers * cscBadChambers
std::vector< PSimHit > hitsFromSimTrack(SimHitIdpr truthId)
unsigned int nStrips() const
Abs< T >::type abs(const T &t)
float adcs(unsigned int strip, unsigned int timebin) const
Map of strip ADCs for strips comprising the rechit.
How EventSelector::AcceptEvent() decides whether to accept an event for output otherwise it is excluding the probing of A single or multiple positive and the trigger will pass if any such matching triggers are PASS or EXCEPTION[A criterion thatmatches no triggers at all is detected and causes a throw.] A single negative with an expectation of appropriate bit checking in the decision and the trigger will pass if any such matching triggers are FAIL or EXCEPTION A wildcarded negative criterion that matches more than one trigger in the trigger but the state exists so we define the behavior If all triggers are the negative crieriion will lead to accepting the event(this again matches the behavior of"!*"before the partial wildcard feature was incorporated).The per-event"cost"of each negative criterion with multiple relevant triggers is about the same as!*was in the past
void analyze(const CSCRecHit2D &recHit)
iterator end()
Return the off-the-end iterator.
int channel(int strip) const
MuonTruth(const edm::Event &, const edm::EventSetup &, const edm::ParameterSet &)
T const * product() const
int getWireGroup() const
default
T const * product() const
ESHandle< TrackerGeometry > geometry
const CSCLayer * layer(CSCDetId id) const
Return the layer corresponding to given DetId.
std::vector< PSimHit > PSimHitContainer
DetId geographicalId() const
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
void addChannel(const LayerLinks &layerLinks, int channel, float weight=1.)
void setup(std::vector< TH2F > &depth, std::string name, std::string units="")
void initEvent(const edm::Event &, const edm::EventSetup &)