Skip to content

Commit

Permalink
Merge pull request #28235 from ssekmen/fastsimdedxandmuonfixes_102X
Browse files Browse the repository at this point in the history
FastSim: fixes for dedx and charginos as muons
  • Loading branch information
cmsbuild committed Oct 23, 2019
2 parents f44285a + 3f9ce01 commit 21c84ce
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 6 deletions.
12 changes: 8 additions & 4 deletions FastSimulation/Calorimetry/src/CalorimetryManager.cc
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,7 @@ void CalorimetryManager::reconstructTrack(FSimTrack& myTrack, RandomEngineAndDis
// Check that the particle hasn't decayed
if(myTrack.noEndVertex()) {
// Simulate energy smearing for photon and electrons
float charge_ = (float)(myTrack.charge());
if ( pid == 11 || pid == 22 ) {

if ( myTrack.onEcal() )
Expand All @@ -215,7 +216,7 @@ void CalorimetryManager::reconstructTrack(FSimTrack& myTrack, RandomEngineAndDis
else reconstructHCAL(myTrack, random);
}
} // electron or photon
else if (pid==13)
else if (pid == 13 || pid == 1000024 || (pid > 1000100 && pid < 1999999 && fabs(charge_) > 0.001))
{
MuonMipSimulation(myTrack, random);
}
Expand Down Expand Up @@ -476,7 +477,8 @@ void CalorimetryManager::reconstructHCAL(const FSimTrack& myTrack,
double EGen = myTrack.hcalEntrance().e();
double emeas = 0.;

if(pid == 13) {
float charge_ = (float)myTrack.charge();
if (pid == 13 || pid == 1000024 || (pid > 1000100 && pid < 1999999 && fabs(charge_) > 0.001)) {
emeas = myHDResponse_->responseHCAL(0, EGen, pathEta, 2, random); // 2=muon
if(debug_)
LogInfo("FastCalorimetry") << "CalorimetryManager::reconstructHCAL - MUON !!!" << std::endl;
Expand Down Expand Up @@ -1314,8 +1316,10 @@ void CalorimetryManager::loadMuonSimTracks(edm::SimTrackContainer &muons) const
unsigned size=muons.size();
for(unsigned i=0; i<size;++i)
{
int id=muons[i].trackId();
if(abs(muons[i].type())!=13) continue;
int id = muons[i].trackId();
if (!(abs(muons[i].type()) == 13 || abs(muons[i].type()) == 1000024 ||
(abs(muons[i].type()) > 1000100 && abs(muons[i].type()) < 1999999)))
continue;
// identify the corresponding muon in the local collection

std::vector<FSimTrack>::const_iterator itcheck=find_if(muonSimTracks.begin(),muonSimTracks.end(),FSimTrackEqual(id));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ MuonSimHitProducer::produce(edm::Event& iEvent,const edm::EventSetup& iSetup) {
// Decaying hadrons are now in the list, and so are their muon daughter
// Ignore the hadrons here.
int pid = mySimTrack.type();
if ( abs(pid) != 13 ) continue;
if ( abs(pid) != 13 && abs(pid) != 1000024) continue;

double t0 = 0;
GlobalPoint initialPosition;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -248,8 +248,12 @@ void FastTrackDeDxProducer::produce(edm::Event& iEvent, const edm::EventSetup& i

void FastTrackDeDxProducer::processHit(const FastTrackerRecHit &recHit, float trackMomentum, float& cosine, reco::DeDxHitCollection& dedxHits, int& NClusterSaturating){

if (!recHit.isValid()) return;

if(!recHit.isValid())return;
auto const& thit = static_cast<BaseTrackerRecHit const&>(recHit);
if (!thit.isValid()) return;

if (!thit.hasPositionAndError()) return;

if(recHit.isPixel()){
if(!usePixel) return;
Expand Down

0 comments on commit 21c84ce

Please sign in to comment.