47 return (a.
tof() < b.
tof());
58 theTracker = trackerHandle.
product();
86 ev.
getByLabel(
"g4SimHits",
"EcalHitsEB", simHitsBarrel);
92 ev.
getByLabel(
"g4SimHits",
"EcalHitsEE", simHitsEndcap);
123 file <<
", If[st, {RGBColor[0.5,0.5,0.5]";
125 for(TrackingParticleCollection::const_iterator simTrack = simTracks->begin();
126 simTrack!= simTracks->end();
131 #warning "This file has been modified just to get it to compile without any regard as to whether it still functions as intended"
132 #ifdef REMOVED_JUST_TO_GET_IT_TO_COMPILE__THIS_CODE_NEEDS_TO_BE_CHECKED
133 simHits = simTrack->trackPSimHit();
139 for(std::vector<PSimHit>::const_iterator simHit = simHits.begin();
140 simHit!= simHits.end(); simHit++)
144 if(theTracker->idToDetUnit(
id) != 0)
147 theTracker->idToDetUnit(
id)->toGlobal(simHit->localPosition());
149 theTracker->idToDetUnit(
id)->toGlobal(simHit->localDirection());
152 file <<
", Point[{" << p1.
x() <<
"," << p1.
y() <<
",(" << p1.
z() <<
"-zs)*mz}]"
154 file <<
", Text[StyleForm[\"s\", URL->\"SimHit | Ekin="
155 << simTrack->energy() - simTrack->mass()
156 <<
" GeV | parent: source="
157 << simTrack->parentVertex()->nSourceTracks()
158 <<
" daughter=" << simTrack->parentVertex()->nDaughterTracks()
160 << p1.
x() <<
"," << p1.
y() <<
",(" << p1.
z() <<
"-zs)*mz}, {1,1}]"
164 double x = theTracker->idToDet(
id)->surface().bounds().width() /2;
165 double y = theTracker->idToDet(
id)->surface().bounds().length()/2;
173 if(theTracker->idToDet(
id)->subDetector() ==
175 theTracker->idToDet(
id)->subDetector() ==
177 file <<
", If[sd, {RGBColor[0.6,0.6,0.6], ";
179 file <<
", If[sd, {RGBColor[0.8,0.8,0.8], ";
181 file <<
"Line[{{"<< p00.
x()<<
","<<p00.
y()<<
",("<<p00.
z()<<
"-zs)*mz}, "
182 <<
"{"<< p01.
x()<<
","<<p01.
y()<<
",("<<p01.
z()<<
"-zs)*mz}, "
183 <<
"{"<< p11.
x()<<
","<<p11.
y()<<
",("<<p11.
z()<<
"-zs)*mz}, "
184 <<
"{"<< p10.
x()<<
","<<p10.
y()<<
",("<<p10.
z()<<
"-zs)*mz}, "
185 <<
"{"<< p00.
x()<<
","<<p00.
y()<<
",("<<p00.
z()<<
"-zs)*mz}}]}]"
188 if(simHit == simHits.begin())
191 simTrack->vertex().y(),
192 simTrack->vertex().z());
196 if(simHit+1 != simHits.end())
200 theTracker->idToDetUnit(
id)->toGlobal((simHit+1)->localPosition());
202 theTracker->idToDetUnit(
id)->toGlobal((simHit+1)->localDirection());
208 if(simHit+1 == simHits.end())
212 theTracker->idToDetUnit(
id)->toGlobal(simHit->localPosition());
217 for(edm::PCaloHitContainer::const_iterator
218 simHit = simHitsBarrel->begin();
219 simHit!= simHitsBarrel->end(); simHit++)
220 if(simHit->geantTrackId() ==
static_cast<int>(simTrack->g4Track_begin()->trackId()) &&
221 simHit->energy() > 0.060)
227 file <<
", Line[{{" << p.x()
229 <<
",(" << p.z() <<
"-zs)*mz}"
230 <<
", {" << cell->getPosition().x() <<
","
231 << cell->getPosition().y() <<
",("
232 << cell->getPosition().z() <<
"-zs)*mz}}]" << std::endl;
240 for(edm::PCaloHitContainer::const_iterator
241 simHit = simHitsEndcap->begin();
242 simHit!= simHitsEndcap->end(); simHit++)
243 if(simHit->geantTrackId() ==
static_cast<int>(simTrack->g4Track_begin()->trackId()) &&
244 simHit->energy() > 0.060)
250 file <<
", Line[{{" << p.x()
252 <<
",(" << p.z() <<
"-zs)*mz}"
253 <<
", {" << cell->getPosition().x() <<
","
254 << cell->getPosition().y() <<
",("
255 << cell->getPosition().z() <<
"-zs)*mz}}]" << std::endl;
void printHelix(const GlobalPoint &p1, const GlobalPoint &p2, const GlobalVector &n2, std::ofstream &outFile, int charge)
float tof() const
deprecated name for timeOfFlight()
void printSimTracks(const edm::Event &ev, const edm::EventSetup &es)
std::vector< TrackingParticle > TrackingParticleCollection
virtual const CaloCellGeometry * getGeometry(const DetId &id) const
Get the cell geometry of a given detector id. Should return false if not found.
float pabs() const
fast and more accurate access to momentumAtEntry().mag()
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
PlotSimTracks(const edm::EventSetup &es, std::ofstream &file_)
T const * product() const
T const * product() const
static std::string getInfo(const DetId &id, const TrackerTopology *tTopo)