Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove Trajectory from event #17098

Merged
merged 73 commits into from
Jan 31, 2017
Merged
Show file tree
Hide file tree
Changes from 36 commits
Commits
Show all changes
73 commits
Select commit Hold shift + click to select a range
b25478d
remove Trajectory in Event for GSF
VinInn Dec 7, 2016
2c35358
add trajectory params to TrackExtra
VinInn Dec 16, 2016
2d4d228
add TrajParams fillers
VinInn Dec 16, 2016
11365b0
add TrajParams fillers
VinInn Dec 16, 2016
ea82573
remove obsolete (missleading) param
VinInn Dec 17, 2016
043f0fb
migrate DeDx
VinInn Dec 17, 2016
2c71b59
copy trajparam as well
VinInn Dec 17, 2016
48a127e
migrate DeDx
VinInn Dec 17, 2016
14f05bc
migrate DeDx
VinInn Dec 17, 2016
ff499c1
Merged removenonsenseerroralongtrajectory from repository VinInn
VinInn Dec 17, 2016
cd35883
Merged NoTrajGSF from repository VinInn
VinInn Dec 17, 2016
a964a5d
port conversion
VinInn Dec 17, 2016
377b221
more migration
VinInn Dec 20, 2016
17f7f90
fix one more cloner
VinInn Dec 20, 2016
a2bca82
clean one more dedx producer
VinInn Dec 20, 2016
91ebc47
migrate strip DQM
VinInn Dec 20, 2016
926927d
protect pixel residuals (migration later)
VinInn Dec 21, 2016
e4e4cd5
PixelPHaseI DQM migrated
VinInn Dec 21, 2016
ecbd38d
protect pixel efficiency as well
VinInn Dec 21, 2016
4bbdef8
protect alignment TrackerValidation as well
VinInn Dec 21, 2016
5084c3e
removed trajectory from GoodSeedProducres
VinInn Dec 21, 2016
8d784df
Merged FixTrajInGoodSeedProd from repository VinInn
VinInn Dec 21, 2016
f64aa55
remove trajectory by default
VinInn Dec 21, 2016
07d5a4c
Merged TrajInTrack9X from repository VinInn
VinInn Dec 21, 2016
0623bdf
modernize SiStripTrackingRecHitsValid
VinInn Dec 22, 2016
76505b5
migrated another bunch of dedx and hi clusRemover (tobefixed)
VinInn Dec 22, 2016
29db0a6
migrated phase2 clusRemover (tobefixed)
VinInn Dec 22, 2016
6b60325
forgot one
VinInn Dec 22, 2016
4fdaaa5
revert cosmics
VinInn Dec 22, 2016
56cf968
add hit chi2 to extra
VinInn Dec 22, 2016
7ad7ba6
added chi2 and migrated producrs
VinInn Dec 22, 2016
f2530c7
added chi2 and migrated producrs
VinInn Dec 22, 2016
4a9ec6d
more producers
VinInn Dec 23, 2016
8504795
use chi2 in cluster remover
VinInn Dec 23, 2016
42f8e82
fix hlt as well
VinInn Dec 23, 2016
2c2fdbf
fix PR number in hlt customizer
VinInn Dec 23, 2016
7bea6fd
fixed more cloner, modernized muontrack loader
VinInn Dec 24, 2016
16f656b
fix HLT as well
VinInn Dec 24, 2016
f9ef794
fix drammatically stupid not copy/paste bug
VinInn Dec 24, 2016
0078b23
fix HI HLT
VinInn Dec 25, 2016
52a3b2d
add customiser to switch TrajInEvent On
VinInn Dec 25, 2016
2d6ddfd
fix merge-conflict
VinInn Jan 9, 2017
ce3d022
Merged TrajInTrack9X from repository VinInn
VinInn Jan 9, 2017
e2a486e
fix traj position
VinInn Jan 9, 2017
a6b906a
Merge branch 'CMSSW_9_0_X' into from-CMSSW_9_0_X_2017-01-08-2300
VinInn Jan 9, 2017
4f66515
fix bug, took the opportunity to write it as it should
VinInn Jan 9, 2017
a76f152
cleanup, renaming, rounding
VinInn Jan 10, 2017
f5edfb3
handle first hit invalid in coversion (bha)
VinInn Jan 10, 2017
430b5f5
use a reift to access trajectory
VinInn Jan 18, 2017
082038e
use a reift to access trajectory
VinInn Jan 18, 2017
f564f95
use a reift to access trajectory
VinInn Jan 18, 2017
8b0871d
python compiles
VinInn Jan 18, 2017
919f19c
clone for HI, add name of coll in error
VinInn Jan 18, 2017
e3c1fab
do not overwrite defaults
VinInn Jan 18, 2017
ef9340f
fix residual version 2 as well
VinInn Jan 18, 2017
f77b0cf
Merged TrajInTrack9X from repository VinInn
VinInn Jan 22, 2017
1a0cccb
upgrade trackresidual to be useful for DQM and more
VinInn Jan 22, 2017
3e744e4
migrated filler of residuals
VinInn Jan 22, 2017
515e9ba
migrate the only client of residuals
VinInn Jan 22, 2017
0c50a61
forgot setters
VinInn Jan 22, 2017
d56cdc1
use TrackExtra if Trajectory not available
VinInn Jan 23, 2017
1956cc1
Merged TrajInTrack9X from repository VinInn
VinInn Jan 23, 2017
b4a75b4
Merge branch 'CMSSW_9_0_X' into from-CMSSW_9_0_X_2017-01-22-1100
VinInn Jan 23, 2017
619b940
use refitted in strip as well
VinInn Jan 24, 2017
83188ea
do not use refitted for tracking
VinInn Jan 24, 2017
bc21d02
use refitted in strip as well
VinInn Jan 24, 2017
59e2ded
make iteration to iterate
VinInn Jan 24, 2017
4bc0df5
derefence handle not nulptr
VinInn Jan 24, 2017
ed37f96
merge with HEAD
VinInn Jan 30, 2017
2e711b1
Merged TrajInTrack9X from repository VinInn
VinInn Jan 30, 2017
8ff56c4
Merge branch 'CMSSW_9_0_X' into from-CMSSW_9_0_X_2017-01-29-1100
VinInn Jan 30, 2017
e0ee364
fix traj position
VinInn Jan 30, 2017
156550b
add return process
VinInn Jan 30, 2017
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

#include "FWCore/ParameterSet/interface/ParameterSet.h"
#include "FWCore/Framework/interface/ConsumesCollector.h"
#include "FWCore/Framework/interface/Frameworkfwd.h"
Expand Down Expand Up @@ -328,6 +327,7 @@ TrackerValidationVariables::fillTrackQuantities(const edm::Event& event,

edm::Handle<TrajTrackAssociationCollection> TrajTracksMap;
event.getByToken(trajTracksToken_, TrajTracksMap);
if(!TrajTracksMap.isValid()) return;
LogDebug("TrackerValidationVariables") << "TrajTrack collection size " << TrajTracksMap->size();

const Trajectory* trajectory;
Expand Down
2 changes: 2 additions & 0 deletions CommonTools/RecoAlgos/interface/GsfElectronSelector.h
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,8 @@ namespace helper {
++nHitsToAdd;
}
tx.setHits( rHits, hidx, nHitsToAdd );
tx.setTrajParams(trk.extra()->trajParams(),trk.extra()->chi2s());
assert(tx.trajParams().size()==tx.recHitsSize());
hidx += nHitsToAdd;
trk.setGsfExtra( GsfTrackExtraRef( rGsfTrackExtras, tidx ) );
trk.setExtra( TrackExtraRef( rTrackExtras, tidx ++ ) );
Expand Down
3 changes: 2 additions & 1 deletion CommonTools/RecoAlgos/interface/TrackFullCloneSelectorBase.h
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,8 @@ class TrackFullCloneSelectorBase : public edm::stream::EDProducer<> {
selHits_->push_back( (*hit)->clone() );
}
tx.setHits( rHits, firstHitIndex, selHits_->size() - firstHitIndex );

tx.setTrajParams(trk.extra()->trajParams(),trk.extra()->chi2s());
assert(tx.trajParams().size()==tx.recHitsSize());
if (copyTrajectories_) {
goodTracks[current] = reco::TrackRef(rTracks, selTracks_->size() - 1);
}
Expand Down
1 change: 1 addition & 0 deletions DQM/SiPixelMonitorTrack/src/SiPixelHitEfficiencySource.cc
Original file line number Diff line number Diff line change
Expand Up @@ -293,6 +293,7 @@ void SiPixelHitEfficiencySource::analyze(const edm::Event& iEvent, const edm::Ev
//get the map
edm::Handle<TrajTrackAssociationCollection> match;
iEvent.getByToken( tracksrc_, match );
if (!match.isValid()) return;
const TrajTrackAssociationCollection ttac = *(match.product());

if(debug_){
Expand Down
38 changes: 20 additions & 18 deletions DQM/SiPixelMonitorTrack/src/SiPixelTrackResidualSource.cc
Original file line number Diff line number Diff line change
Expand Up @@ -946,24 +946,12 @@ void SiPixelTrackResidualSource::analyze(const edm::Event& iEvent, const edm::Ev

}//-----Tracks
////////////////////////////
//get trajectories
edm::Handle<std::vector<Trajectory> > trajCollectionHandle;
//iEvent.getByLabel(tracksrc_,trajCollectionHandle);
iEvent.getByToken ( tracksrcToken_, trajCollectionHandle );
auto const & trajColl = *(trajCollectionHandle.product());

//get tracks
edm::Handle<std::vector<reco::Track> > trackCollectionHandle;
//iEvent.getByLabel(tracksrc_,trackCollectionHandle);
iEvent.getByToken( trackToken_, trackCollectionHandle );
auto const & trackColl = *(trackCollectionHandle.product());

//get the map
edm::Handle<TrajTrackAssociationCollection> match;
//iEvent.getByLabel(tracksrc_,match);
iEvent.getByToken( trackAssociationToken_, match);
auto const & ttac = *(match.product());

// get clusters
edm::Handle< edmNew::DetSetVector<SiPixelCluster> > clusterColl;
//iEvent.getByLabel( clustersrc_, clusterColl );
Expand All @@ -976,18 +964,30 @@ void SiPixelTrackResidualSource::analyze(const edm::Event& iEvent, const edm::Ev
const edm::DetSetVector<PixelDigi> diginp = *(digiinput.product());


if(debug_){
std::cout << "Trajectories\t : " << trajColl.size() << std::endl;
std::cout << "recoTracks \t : " << trackColl.size() << std::endl;
std::cout << "Map entries \t : " << ttac.size() << std::endl;
}

std::set<SiPixelCluster> clusterSet;
TrajectoryStateCombiner tsoscomb;
int tracks=0, pixeltracks=0, bpixtracks=0, fpixtracks=0;
int trackclusters=0, barreltrackclusters=0, endcaptrackclusters=0;
int otherclusters=0, barrelotherclusters=0, endcapotherclusters=0;

//get trajectories
edm::Handle<std::vector<Trajectory> > trajCollectionHandle;
iEvent.getByToken ( tracksrcToken_, trajCollectionHandle );
if (trajCollectionHandle.isValid()) {

auto const & trajColl = *(trajCollectionHandle.product());
//get the map
edm::Handle<TrajTrackAssociationCollection> match;
iEvent.getByToken( trackAssociationToken_, match);
auto const & ttac = *(match.product());
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

indentation is missing.
Please indent for readability ... it looks like a ~250 line reindentation though (can be ignored in checks on github with ?w=1)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this file is "obsolete" as its functionality will be replaced by the new PhaseI code


if(debug_){
std::cout << "Trajectories\t : " << trajColl.size() << std::endl;
std::cout << "recoTracks \t : " << trackColl.size() << std::endl;
std::cout << "Map entries \t : " << ttac.size() << std::endl;
}


//Loop over map entries
for(TrajTrackAssociationCollection::const_iterator it = ttac.begin();it != ttac.end(); ++it){
const edm::Ref<std::vector<Trajectory> > traj_iterator = it->key;
Expand Down Expand Up @@ -1226,6 +1226,8 @@ void SiPixelTrackResidualSource::analyze(const edm::Event& iEvent, const edm::Ev

}//end loop on map entries

} // end valid trajectory:

//find clusters that are NOT on track
//edmNew::DetSet<SiPixelCluster>::const_iterator di;
if(debug_) std::cout << "clusters not on track: (size " << clustColl.size() << ") ";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

#include "DQM/SiPixelPhase1Common/interface/SiPixelPhase1Base.h"
#include "DataFormats/SiPixelCluster/interface/SiPixelCluster.h"
#include "TrackingTools/PatternTools/interface/TrajTrackAssociation.h"
#include "DataFormats/TrackReco/interface/TrackFwd.h"

class SiPixelPhase1TrackClusters : public SiPixelPhase1Base {
enum {
Expand All @@ -36,7 +36,7 @@ class SiPixelPhase1TrackClusters : public SiPixelPhase1Base {

private:
edm::EDGetTokenT<edmNew::DetSetVector<SiPixelCluster> > clustersToken_;
edm::EDGetTokenT<TrajTrackAssociationCollection> trackAssociationToken_;
edm::EDGetTokenT<reco::TrackCollection> tracksToken_;
};

#endif
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@

SiPixelPhase1TrackClustersAnalyzer = cms.EDAnalyzer("SiPixelPhase1TrackClusters",
clusters = cms.InputTag("siPixelClusters"),
trajectories = cms.InputTag("generalTracks"),
tracks = cms.InputTag("generalTracks"),
histograms = SiPixelPhase1TrackClustersConf,
geometry = SiPixelPhase1Geometry
)
Expand Down
29 changes: 11 additions & 18 deletions DQM/SiPixelPhase1TrackClusters/src/SiPixelPhase1TrackClusters.cc
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ SiPixelPhase1TrackClusters::SiPixelPhase1TrackClusters(const edm::ParameterSet&
SiPixelPhase1Base(iConfig)
{
clustersToken_ = consumes<edmNew::DetSetVector<SiPixelCluster>>(iConfig.getParameter<edm::InputTag>("clusters"));
trackAssociationToken_ = consumes<TrajTrackAssociationCollection>(iConfig.getParameter<edm::InputTag>("trajectories"));
tracksToken_ = consumes<reco::TrackCollection>(iConfig.getParameter<edm::InputTag>("tracks"));
}

void SiPixelPhase1TrackClusters::analyze(const edm::Event& iEvent, const edm::EventSetup& iSetup) {
Expand All @@ -37,36 +37,33 @@ void SiPixelPhase1TrackClusters::analyze(const edm::Event& iEvent, const edm::Ev
assert(tracker.isValid());

//get the map
edm::Handle<TrajTrackAssociationCollection> ttac;
iEvent.getByToken( trackAssociationToken_, ttac);
edm::Handle<reco::TrackCollection> tracks;
iEvent.getByToken( tracksToken_, tracks);

// get clusters
edm::Handle< edmNew::DetSetVector<SiPixelCluster> > clusterColl;
iEvent.getByToken( clustersToken_, clusterColl );

TrajectoryStateCombiner tsoscomb;

// we need to store some per-cluster data. Instead of a map, we use a vector,
// exploiting the fact that all custers live in the DetSetVector and we can
// use the same indices to refer to them.
// corr_charge is not strictly needed but cleaner to have it.
std::vector<bool> ontrack (clusterColl->data().size(), false);
std::vector<float> corr_charge(clusterColl->data().size(), -1.0f);

for (auto& item : *ttac) {
auto trajectory_ref = item.key;
reco::TrackRef track_ref = item.val;
for (auto const & track : *tracks) {

bool isBpixtrack = false, isFpixtrack = false, crossesPixVol=false;

// find out whether track crosses pixel fiducial volume (for cosmic tracks)
double d0 = track_ref->d0(), dz = track_ref->dz();
double d0 = track.d0(), dz = track.dz();
if(std::abs(d0)<15 && std::abs(dz)<50) crossesPixVol = true;

for (auto& measurement : trajectory_ref->measurements()) {
// check if things are all valid
if (!measurement.updatedState().isValid()) continue;
auto hit = measurement.recHit();
auto const & trajParams = track.extra()->trajParams();
assert(trajParams.size()==track.recHitsSize());
auto hb = track.recHitsBegin();
for(unsigned int h=0;h<track.recHitsSize();h++){
auto hit = *(hb+h);
if (!hit->isValid()) continue;
DetId id = hit->geographicalId();

Expand All @@ -83,13 +80,9 @@ void SiPixelPhase1TrackClusters::analyze(const edm::Event& iEvent, const edm::Ev
if (clust.isNull()) continue;
ontrack[clust.key()] = true; // mark cluster as ontrack

// compute trajectory parameters at hit
TrajectoryStateOnSurface tsos = tsoscomb(measurement.forwardPredictedState(),
measurement.backwardPredictedState());
if (!tsos.isValid()) continue;

// correct charge for track impact angle
LocalTrajectoryParameters ltp = tsos.localParameters();
auto const & ltp = trajParams[h];
LocalVector localDir = ltp.momentum()/ltp.momentum().mag();

float clust_alpha = atan2(localDir.z(), localDir.x());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

#include "DQM/SiPixelPhase1Common/interface/SiPixelPhase1Base.h"
#include "DataFormats/SiPixelCluster/interface/SiPixelCluster.h"
#include "TrackingTools/PatternTools/interface/TrajTrackAssociation.h"
#include "DataFormats/TrackReco/interface/TrackFwd.h"
#include "DataFormats/VertexReco/interface/VertexFwd.h"

class SiPixelPhase1TrackEfficiency : public SiPixelPhase1Base {
Expand All @@ -26,7 +26,7 @@ class SiPixelPhase1TrackEfficiency : public SiPixelPhase1Base {

private:
edm::EDGetTokenT<edmNew::DetSetVector<SiPixelCluster> > clustersToken_;
edm::EDGetTokenT<TrajTrackAssociationCollection> trackAssociationToken_;
edm::EDGetTokenT<reco::TrackCollection> tracksToken_;
edm::EDGetTokenT<reco::VertexCollection> vtxToken_;
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@

SiPixelPhase1TrackEfficiencyAnalyzer = cms.EDAnalyzer("SiPixelPhase1TrackEfficiency",
clusters = cms.InputTag("siPixelClusters"),
trajectories = cms.InputTag("generalTracks"),
tracks = cms.InputTag("generalTracks"),
primaryvertices = cms.InputTag("offlinePrimaryVertices"),
histograms = SiPixelPhase1TrackEfficiencyConf,
geometry = SiPixelPhase1Geometry
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@

SiPixelPhase1TrackEfficiency::SiPixelPhase1TrackEfficiency(const edm::ParameterSet& iConfig) :
SiPixelPhase1Base(iConfig)
{
trackAssociationToken_ = consumes<TrajTrackAssociationCollection>(iConfig.getParameter<edm::InputTag>("trajectories"));
{
tracksToken_ = consumes<reco::TrackCollection>(iConfig.getParameter<edm::InputTag>("tracks"));
vtxToken_ = consumes<reco::VertexCollection>(iConfig.getParameter<edm::InputTag>("primaryvertices"));
}

Expand All @@ -43,22 +43,19 @@ void SiPixelPhase1TrackEfficiency::analyze(const edm::Event& iEvent, const edm::
//const auto primaryVertex = vertices->at(0);

// get the map
edm::Handle<TrajTrackAssociationCollection> ttac;
iEvent.getByToken( trackAssociationToken_, ttac);
edm::Handle<reco::TrackCollection> tracks;
iEvent.getByToken( tracksToken_, tracks);

for (auto& item : *ttac) {
auto trajectory_ref = item.key;
reco::TrackRef track_ref = item.val;
for (auto const & track : *tracks) {

bool isBpixtrack = false, isFpixtrack = false;
int nStripHits = 0;

// first, look at the full track to see whether it is good
for (auto& measurement : trajectory_ref->measurements()) {
// check if things are all valid
if (!measurement.updatedState().isValid()) continue;
auto hit = measurement.recHit();
if (!hit->isValid()) continue;
auto hb = track.recHitsBegin();
for(unsigned int h=0;h<track.recHitsSize();h++){
auto hit = *(hb+h);
if(!hit->isValid()) continue;

DetId id = hit->geographicalId();
uint32_t subdetid = (id.subdetId());
Expand All @@ -77,9 +74,8 @@ void SiPixelPhase1TrackEfficiency::analyze(const edm::Event& iEvent, const edm::
if (!isBpixtrack && !isFpixtrack) continue;

// then, look at each hit
for (auto& measurement : trajectory_ref->measurements()) {
if (!measurement.updatedState().isValid()) continue;
auto hit = measurement.recHit();
for(unsigned int h=0;h<track.recHitsSize();h++){
auto hit = *(hb+h);

DetId id = hit->geographicalId();
uint32_t subdetid = (id.subdetId());
Expand Down
6 changes: 2 additions & 4 deletions DQM/SiStripMonitorTrack/interface/SiStripMonitorTrack.h
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,8 @@ class SiStripMonitorTrack : public DQMEDAnalyzer {
// internal evaluation of monitorables
void AllClusters(const edm::Event& ev, const edm::EventSetup& es);
void trackStudyFromTrack(edm::Handle<reco::TrackCollection > trackCollectionHandle, const edm::EventSetup& es);
void trackStudyFromTrajectory(edm::Handle<TrajTrackAssociationCollection> TItkAssociatorCollection, const edm::EventSetup& es);
void trajectoryStudy(const edm::Ref<std::vector<Trajectory> > traj, const edm::EventSetup& es, bool track_ok);
void trackStudyFromTrajectory(edm::Handle<reco::TrackCollection > trackCollectionHandle, const edm::EventSetup& es);
void trajectoryStudy(const reco::Track& track, const edm::EventSetup& es, bool track_ok);
void trackStudy(const edm::Event& ev, const edm::EventSetup& es);
bool trackFilter(const reco::Track& track);
// LocalPoint project(const GeomDet *det,const GeomDet* projdet,LocalPoint position,LocalVector trackdirection)const;
Expand Down Expand Up @@ -214,8 +214,6 @@ class SiStripMonitorTrack : public DQMEDAnalyzer {

edm::EDGetTokenT<edmNew::DetSetVector<SiStripCluster> > clusterToken_;
edm::EDGetTokenT<reco::TrackCollection> trackToken_;
// edm::EDGetTokenT<std::vector<Trajectory> > trajectoryToken_;
edm::EDGetTokenT<TrajTrackAssociationCollection> trackTrajToken_;

bool Mod_On_;
bool Trend_On_;
Expand Down
Loading