Skip to content

Commit

Permalink
more code review and bug fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
lgray committed Jan 8, 2019
1 parent 7b73cbc commit 6e9e477
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 34 deletions.
4 changes: 3 additions & 1 deletion Configuration/StandardSequences/python/Reconstruction_cff.py
Expand Up @@ -127,7 +127,9 @@

_phase2_timing_layer_globalreco = _run3_globalreco.copy()
_phase2_timing_layer_globalreco += fastTimingGlobalReco
phase2_timing_layer.toReplaceWith(globalreco,_phase2_timing_layer_globalreco)
from Configuration.Eras.Modifier_phase2_timing_layer_tile_cff import phase2_timing_layer_tile
from Configuration.Eras.Modifier_phase2_timing_layer_bar_cff import phase2_timing_layer_bar
(phase2_timing_layer_tile | phase2_timing_layer_bar).toReplaceWith(globalreco,_phase2_timing_layer_globalreco)

_fastSim_globalreco = globalreco.copyAndExclude([CastorFullReco,muoncosmicreco])
# insert the few tracking modules to be run after mixing back in the globalreco sequence
Expand Down
1 change: 0 additions & 1 deletion RecoLocalFastTime/Records/BuildFile.xml
Expand Up @@ -4,5 +4,4 @@
<use name="FWCore/Utilities"/>
<use name="FWCore/Framework"/>
<use name="Geometry/Records"/>
<use name="clhep"/>
<use name="boost"/>
24 changes: 6 additions & 18 deletions RecoMTD/Configuration/python/RecoMTD_EventContent_cff.py
@@ -1,26 +1,14 @@
import FWCore.ParameterSet.Config as cms

#FEVT
RecoMTDFEVT = cms.PSet(
#AOD
RecoMTDAOD = cms.PSet(
outputCommands = cms.untracked.vstring(
'keep *_trackExtenderWithMTD_*_*'
)
)

#RECO content
RecoMTDRECO = RecoMTDFEVT.copy()
RecoMTDRECO = RecoMTDAOD.copy()

#AOD content
RecoMTDAOD = RecoMTDFEVT.copy()

_phase2TimingLayer_EventContent = cms.untracked.vstring('keep *_trackExtenderWithMTD_*_*')

from Configuration.Eras.Modifier_phase2_timing_layer_tile_cff import phase2_timing_layer_tile
from Configuration.Eras.Modifier_phase2_timing_layer_bar_cff import phase2_timing_layer_bar

def modifyDataTier(DataTier):
added = DataTier.outputCommands + _phase2TimingLayer_EventContent
(phase2_timing_layer_tile | phase2_timing_layer_bar).toModify(DataTier, outputCommands = added)

modifyDataTier(RecoMTDFEVT)
modifyDataTier(RecoMTDRECO)
modifyDataTier(RecoMTDAOD)
#FEVT content
RecoMTDFEVT = RecoMTDRECO.copy()
25 changes: 12 additions & 13 deletions RecoMTD/TrackExtender/plugins/TrackExtenderWithMTD.cc
Expand Up @@ -243,28 +243,27 @@ void TrackExtenderWithMTDT<TrackCollection>::produce( edm::Event& ev,
for( const auto& track : tracks ) {

reco::TransientTrack ttrack(track,magfield.product(),gtg);
auto trajs = theTransformer->transform(track);
const auto& trajs = theTransformer->transform(track);
auto thits = theTransformer->getTransientRecHits(ttrack);

TransientTrackingRecHit::ConstRecHitContainer mtdthits;
for( auto& ahit : tryBTLLayers(track,hits,geo.product(),magfield.product(),prop.product()) ) {
mtdthits.push_back(ahit);
}
const auto& btlhits = tryBTLLayers(track,hits,geo.product(),magfield.product(),prop.product());
mtdthits.insert(mtdthits.end(),btlhits.begin(),btlhits.end());

// in the future this should include an intermediate refit before propagating to the ETL
// for now it is ok
for( auto& ahit : tryETLLayers(track,hits,geo.product(),magfield.product(),prop.product()) ) {
mtdthits.push_back(ahit);
}
const auto& etlhits = tryETLLayers(track,hits,geo.product(),magfield.product(),prop.product());
mtdthits.insert(mtdthits.end(),etlhits.begin(),etlhits.end());

auto ordering = checkRecHitsOrdering(thits);
if( ordering == RefitDirection::insideOut) {
for( auto& ahit : mtdthits ) thits.push_back(ahit);
thits.insert(thits.end(),mtdthits.begin(),mtdthits.end());
} else {
std::reverse(mtdthits.begin(),mtdthits.end());
for( auto& ahit : thits ) mtdthits.push_back(ahit);
mtdthits.insert(mtdthits.end(),thits.begin(),thits.end());
thits.swap(mtdthits);
}
auto trajwithmtd = theTransformer->transform(ttrack,thits);
const auto& trajwithmtd = theTransformer->transform(ttrack,thits);
float pathLengthMap = -1.f, betaMap = 0.f, t0Map = 0.f, covt0t0Map = -1.f;

for( const auto& trj : trajwithmtd ) {
Expand All @@ -286,8 +285,8 @@ void TrackExtenderWithMTDT<TrackCollection>::produce( edm::Event& ev,
extras->push_back(buildTrackExtra(trj)); // always push back the fully built extra, update by setting in track
extras->back().setHits(hitsRefProd,hitsstart,hitsend-hitsstart);
extras->back().setTrajParams(trajParams,chi2s);
//create the track
output->push_back(result);
//create the track
output->push_back(result);
pathLengthsRaw.push_back(pathLength);
pathLengthMap = pathLength;
auto& backtrack = output->back();
Expand Down Expand Up @@ -530,7 +529,7 @@ reco::Track TrackExtenderWithMTDT<TrackCollection>::buildTrack(const reco::Track
pathLengthOut = pathlength; // set path length if we've got a timing hit
t0 = thit - dt;
covt0t0 = thiterror*thiterror;
beta = betaOut;
betaOut = beta;
}
}

Expand Down
3 changes: 2 additions & 1 deletion SimFastTiming/FastTimingCommon/src/BTLTileDeviceSim.cc
Expand Up @@ -73,7 +73,8 @@ void BTLTileDeviceSim::getHitsResponse(const std::vector<std::tuple<int,uint32_t
row = btlid.row(topo.nrows());
col = btlid.column(topo.nrows());
}



// --- Store the detector element ID as a key of the MTDSimHitDataAccumulator map
auto simHitIt = simHitAccumulator->emplace(mtd_digitizer::MTDCellId(id,row,col),
mtd_digitizer::MTDCellInfo()).first;
Expand Down

0 comments on commit 6e9e477

Please sign in to comment.