Definition at line 162 of file MuonSimHitProducer.cc.
174 std::vector<PSimHit> theCSCHits;
175 std::vector<PSimHit> theDTHits;
176 std::vector<PSimHit> theRPCHits;
182 for (
unsigned int itrk = 0; itrk < simMuons->size(); itrk++) {
183 const SimTrack& mySimTrack = (*simMuons)[itrk];
189 int pid = mySimTrack.
type();
190 if (
abs(pid) != 13 &&
abs(pid) != 1000024)
196 t0 = (*simVertices)[ivert].position().t();
200 initialPosition = xyzzy;
207 double tof =
t0 / 29.98;
210 std::cout <<
" ===> MuonSimHitProducer::reconstruct() found SIMTRACK - pid = " << pid;
211 std::cout <<
" : pT = " << mySimP4.Pt() <<
", eta = " << mySimP4.Eta() <<
", phi = " << mySimP4.Phi() << std::endl;
229 GlobalVector dtracker = startingPosition - initialPosition;
230 tof += dtracker.
mag() / 29.98;
233 std::cout <<
" the Muon START position " << startingPosition << std::endl;
234 std::cout <<
" the Muon START momentum " << startingMomentum << std::endl;
249 std::vector<const DetLayer*> navLayers;
250 if (fabs(startingState.globalMomentum().eta()) > 4.5) {
251 navLayers = navigation.compatibleEndcapLayers(*(startingState.freeState()),
alongMomentum);
253 navLayers = navigation.compatibleLayers(*(startingState.freeState()),
alongMomentum);
260 if (navLayers.empty())
264 std::cout <<
"Found " << navLayers.size() <<
" compatible DetLayers..." << std::endl;
268 for (
unsigned int ilayer = 0; ilayer < navLayers.size(); ilayer++) {
270 std::cout <<
"Propagating to layer " << ilayer <<
" " << dumper.dumpLayer(navLayers[ilayer]) << std::endl;
273 std::vector<DetWithState> comps =
279 std::cout <<
"Propagating " << propagatedState << std::endl;
289 ->propagate(shsStart, navLayers[ilayer]->surface(), shsDest);
290 std::pair<TrajectoryStateOnSurface, double>
next(shsDest.
getStateOnSurface(navLayers[ilayer]->surface()),
294 if (!
next.first.isValid())
298 double radPath = shsDest.
radPath();
299 double pathLength =
next.second;
303 std::pair<TrajectoryStateOnSurface, double> nextNoMaterial =
307 propagatedState =
next.first;
316 if (!propagatedState.
isValid())
324 double pavg = 0.5 * (
pi +
pf);
325 double m = mySimP4.M();
326 double rbeta =
sqrt(1 +
m *
m / (pavg * pavg)) / 29.98;
327 double dtof = pathLength * rbeta;
330 std::cout <<
"Propagated to next surface... path length = " << pathLength <<
" cm, dTOF = " << dtof <<
" ns"
336 for (
unsigned int icomp = 0; icomp < comps.size(); icomp++) {
337 const GeomDet* gd = comps[icomp].first;
341 std::vector<const DTSuperLayer*> superlayer =
chamber->superLayers();
342 for (
unsigned int isl = 0; isl < superlayer.size(); isl++) {
343 std::vector<const DTLayer*>
layer = superlayer[isl]->layers();
344 for (
unsigned int ilayer = 0; ilayer <
layer.size(); ilayer++) {
357 std::pair<bool, double>
path = crossing.pathLength(det->
surface());
364 int wire = dtTopo.
channel(lpos);
377 double pmu = lmom.
mag();
378 double theDTHitIneff = pmu > 0 ?
exp(
kDT *
log(pmu) +
fDT) : 0.;
379 if (random.flatShoot() < theDTHitIneff)
383 double pz = fabs(lmom.
z());
386 double dtof =
path.second * rbeta;
387 int trkid = mySimTrack.
trackId();
388 unsigned int id = wid.rawId();
389 short unsigned int processType = 2;
391 entry,
exit, lmom.
mag(), tof + dtof, eloss, pid,
id, trkid, lmom.
theta(), lmom.
phi(), processType);
392 theDTHits.push_back(
hit);
399 for (
unsigned int ilayer = 0; ilayer <
layers.size(); ilayer++) {
404 << lid.
layer() <<
")" << std::endl;
412 std::pair<bool, double>
path = crossing.pathLength(det->
surface());
420 if (!laygeom->
inside(lpos))
429 double pmu = lmom.
mag();
430 double theCSCHitIneff = pmu > 0 ?
exp(
kCSC *
log(pmu) +
fCSC) : 0.;
433 theCSCHitIneff = theCSCHitIneff * 0.442;
434 if (random.flatShoot() < theCSCHitIneff)
438 double pz = fabs(lmom.
z());
441 double dtof =
path.second * rbeta;
442 int trkid = mySimTrack.
trackId();
443 unsigned int id = lid.
rawId();
444 short unsigned int processType = 2;
446 entry,
exit, lmom.
mag(), tof + dtof, eloss, pid,
id, trkid, lmom.
theta(), lmom.
phi(), processType);
447 theCSCHits.push_back(
hit);
453 std::vector<const RPCRoll*> roll =
chamber->rolls();
454 for (
unsigned int iroll = 0; iroll < roll.size(); iroll++) {
458 std::cout <<
" Extrapolated to RPC (" <<
rid.ring() <<
"," <<
rid.station() <<
"," <<
rid.sector() <<
","
459 <<
rid.subsector() <<
"," <<
rid.layer() <<
"," <<
rid.roll() <<
")" << std::endl;
467 std::pair<bool, double>
path = crossing.pathLength(det->
surface());
477 double pz = fabs(lmom.
z());
480 double dtof =
path.second * rbeta;
481 int trkid = mySimTrack.
trackId();
482 unsigned int id =
rid.rawId();
483 short unsigned int processType = 2;
485 entry,
exit, lmom.
mag(), tof + dtof, eloss, pid,
id, trkid, lmom.
theta(), lmom.
phi(), processType);
486 theRPCHits.push_back(
hit);
489 std::cout <<
"Extrapolated to unknown subdetector '" << gd->
subDetector() <<
"'..." << std::endl;
497 for (std::vector<PSimHit>::const_iterator
i = theCSCHits.begin();
i != theCSCHits.end();
i++) {
505 for (std::vector<PSimHit>::const_iterator
i = theDTHits.begin();
i != theDTHits.end();
i++) {
513 for (std::vector<PSimHit>::const_iterator
i = theRPCHits.begin();
i != theRPCHits.end();
i++) {
References funct::abs(), alongMomentum, anyDirection, applyMaterialEffects(), PV3DBase< T, PVType, FrameType >::basicVector(), Surface::bounds(), relativeConstraints::chamber, RPCGeometry::chamber(), CSCGeometry::chamber(), DTGeometry::chamber(), DTTopology::channel(), CoreSimTrack::charge(), gather_cfg::cout, GeomDetEnumerators::CSC, cscGeom, MuonServiceProxy::detLayerGeometry(), GeomDetEnumerators::DT, dtGeom, CSCDetId::endcap(), mps_splice::entry, beamvalidation::exit(), JetChargeProducer_cfi::exp, fCSC, fDT, DTTopology::firstChannel(), TrajectoryStateOnSurface::freeTrajectoryState(), GeomDet::geographicalId(), edm::EventSetup::getData(), SteppingHelixStateInfo::getStateOnSurface(), TrajectoryStateOnSurface::globalMomentum(), TrajectoryStateOnSurface::globalPosition(), mps_fire::i, triggerObjects_cff::id, RPCGeometry::idToDetUnit(), DTGeometry::idToDetUnit(), CSCGeometry::idToDetUnit(), iEvent, Bounds::inside(), CSCLayerGeometry::inside(), TrajectoryStateOnSurface::isValid(), kCSC, kDT, DTTopology::lastChannel(), DTLayerId::layer(), CSCDetId::layer(), phase1PixelTopology::layer, hgcalTopologyTester_cfi::layers, TrajectoryStateOnSurface::localMomentum(), dqm-mbProfile::log, visualization-live-secondInstance_cfg::m, PV3DBase< T, PVType, FrameType >::mag(), magfield, CoreSimTrack::momentum(), eostools::move(), dqmiodumpmetadata::n, GetRecoTauVFromDQM_MC_cff::next, castor_dqm_sourceclient_file_cfg::path, SteppingHelixStateInfo::path(), dileptonTrigSettings_cff::pdg, packedPFCandidateRefMixer_cfi::pf, PV3DBase< T, PVType, FrameType >::phi(), pi, PlaneBuilder::plane(), position, propagatorWithMaterial, propagatorWithoutMaterial, SteppingHelixStateInfo::radPath(), DetId::rawId(), bril_dqm_clientPB-live_cfg::rid, CSCDetId::ring(), relativeConstraints::ring, makeMuonMisalignmentScenario::rot, GeomDetEnumerators::RPCBarrel, GeomDetEnumerators::RPCEndcap, rpcGeom, DTChamberId::sector(), simMuonToken, simVertexToken, HGCalValidator_cfi::simVertices, mathSSE::sqrt(), DTChamberId::station(), relativeConstraints::station, CSCDetId::station(), GeomDet::subDetector(), DTSuperLayerId::superlayer(), GeomDet::surface(), FrontierCondition_GT_autoExpress_cfi::t0, theEstimator, theMaterialEffects, theService, PV3DBase< T, PVType, FrameType >::theta(), Bounds::thickness(), Calorimetry_cff::thickness, GeomDet::toLocal(), SimTrack::trackerSurfaceMomentum(), SimTrack::trackerSurfacePosition(), CoreSimTrack::trackId(), TrajectoryStateOnSurface::transverseCurvature(), CoreSimTrack::type(), Vector3DBase< T, FrameTag >::unit(), SimTrack::vertIndex(), DTChamberId::wheel(), x, HLT_FULL_cff::xAxis, y, HLT_FULL_cff::yAxis, z, PV3DBase< T, PVType, FrameType >::z(), and HLT_FULL_cff::zAxis.