test
CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Classes | Public Member Functions | Static Public Member Functions | Private Types | Private Member Functions | Static Private Member Functions | Private Attributes
TrackingNtuple Class Reference

#include <NtupleDump/TrackingNtuple/plugins/TrackingNtuple.cc>

Inheritance diagram for TrackingNtuple:
edm::one::EDAnalyzer< edm::one::SharedResources > edm::one::EDAnalyzerBase edm::EDConsumerBase

Classes

struct  SimHitData
 
struct  TPHitIndex
 

Public Member Functions

 TrackingNtuple (const edm::ParameterSet &)
 
 ~TrackingNtuple ()
 
- Public Member Functions inherited from edm::one::EDAnalyzer< edm::one::SharedResources >
 EDAnalyzer ()=default
 
- Public Member Functions inherited from edm::one::EDAnalyzerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
 EDAnalyzerBase ()
 
ModuleDescription const & moduleDescription () const
 
virtual ~EDAnalyzerBase ()
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
 EDConsumerBase ()
 
 EDConsumerBase (EDConsumerBase const &)=delete
 
 EDConsumerBase (EDConsumerBase &&)=default
 
ProductResolverIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
std::vector
< ProductResolverIndexAndSkipBit >
const & 
itemsToGetFromEvent () const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesWhoseProductsAreConsumed (std::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
bool registeredToConsume (ProductResolverIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
virtual ~EDConsumerBase () noexcept(false)
 

Static Public Member Functions

static void fillDescriptions (edm::ConfigurationDescriptions &descriptions)
 
- Static Public Member Functions inherited from edm::one::EDAnalyzerBase
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 

Private Types

enum  HitSimType {
  HitSimType::Signal = 0, HitSimType::ITPileup = 1, HitSimType::OOTPileup = 2, HitSimType::Noise = 3,
  HitSimType::Unknown = 99
}
 
enum  HitType {
  HitType::Pixel = 0, HitType::Strip = 1, HitType::Glued = 2, HitType::Invalid = 3,
  HitType::Unknown = 99
}
 
typedef std::pair
< TrackPSimHitRef::key_type,
edm::ProductID
SimHitFullKey
 
typedef std::map
< SimHitFullKey, size_t > 
SimHitRefKeyToIndex
 
typedef std::unordered_set
< reco::RecoToSimCollection::index_type
TrackingParticleRefKeySet
 
typedef std::unordered_map
< reco::RecoToSimCollection::index_type,
size_t > 
TrackingParticleRefKeyToIndex
 
typedef
TrackingParticleRefKeyToIndex 
TrackingVertexRefKeyToIndex
 

Private Member Functions

virtual void analyze (const edm::Event &, const edm::EventSetup &) override
 
void clearVariables ()
 
void fillBeamSpot (const reco::BeamSpot &bs)
 
void fillPixelHits (const edm::Event &iEvent, const ClusterTPAssociation &clusterToTPMap, const TrackingParticleRefKeyToIndex &tpKeyToIndex, const SimHitTPAssociationProducer::SimHitTPAssociationList &simHitsTPAssoc, const edm::DetSetVector< PixelDigiSimLink > &digiSimLink, const TransientTrackingRecHitBuilder &theTTRHBuilder, const TrackerTopology &tTopo, const SimHitRefKeyToIndex &simHitRefKeyToIndex, std::set< edm::ProductID > &hitProductIds)
 
void fillSeeds (const edm::Event &iEvent, const TrackingParticleRefVector &tpCollection, const TrackingParticleRefKeyToIndex &tpKeyToIndex, const reco::BeamSpot &bs, const reco::TrackToTrackingParticleAssociator &associatorByHits, const TransientTrackingRecHitBuilder &theTTRHBuilder, const MagneticField *theMF, const std::vector< std::pair< int, int > > &monoStereoClusterList, const std::set< edm::ProductID > &hitProductIds, std::map< edm::ProductID, size_t > &seedToCollIndex)
 
void fillSimHits (const TrackerGeometry &tracker, const TrackingParticleRefKeyToIndex &tpKeyToIndex, const SimHitTPAssociationProducer::SimHitTPAssociationList &simHitsTPAssoc, const TrackerTopology &tTopo, SimHitRefKeyToIndex &simHitRefKeyToIndex, std::vector< TPHitIndex > &tpHitList)
 
void fillStripMatchedHits (const edm::Event &iEvent, const TransientTrackingRecHitBuilder &theTTRHBuilder, const TrackerTopology &tTopo, std::vector< std::pair< int, int > > &monoStereoClusterList)
 
void fillStripRphiStereoHits (const edm::Event &iEvent, const ClusterTPAssociation &clusterToTPMap, const TrackingParticleRefKeyToIndex &tpKeyToIndex, const SimHitTPAssociationProducer::SimHitTPAssociationList &simHitsTPAssoc, const edm::DetSetVector< StripDigiSimLink > &digiSimLink, const TransientTrackingRecHitBuilder &theTTRHBuilder, const TrackerTopology &tTopo, const SimHitRefKeyToIndex &simHitRefKeyToIndex, std::set< edm::ProductID > &hitProductIds)
 
void fillTrackingParticles (const edm::Event &iEvent, const edm::EventSetup &iSetup, const edm::RefToBaseVector< reco::Track > &tracks, const TrackingParticleRefVector &tpCollection, const TrackingVertexRefKeyToIndex &tvKeyToIndex, const reco::TrackToTrackingParticleAssociator &associatorByHits, const std::vector< TPHitIndex > &tpHitList)
 
void fillTrackingVertices (const TrackingVertexRefVector &trackingVertices, const TrackingParticleRefKeyToIndex &tpKeyToIndex)
 
void fillTracks (const edm::RefToBaseVector< reco::Track > &tracks, const TrackingParticleRefVector &tpCollection, const TrackingParticleRefKeyToIndex &tpKeyToIndex, const reco::BeamSpot &bs, const reco::TrackToTrackingParticleAssociator &associatorByHits, const TransientTrackingRecHitBuilder &theTTRHBuilder, const TrackerTopology &tTopo, const std::set< edm::ProductID > &hitProductIds, const std::map< edm::ProductID, size_t > &seedToCollIndex)
 
void fillVertices (const reco::VertexCollection &vertices, const edm::RefToBaseVector< reco::Track > &tracks)
 
template<typename SimLink >
SimHitData matchCluster (const OmniClusterRef &cluster, DetId hitId, int clusterKey, const TransientTrackingRecHit::RecHitPointer &ttrh, const ClusterTPAssociation &clusterToTPMap, const TrackingParticleRefKeyToIndex &tpKeyToIndex, const SimHitTPAssociationProducer::SimHitTPAssociationList &simHitsTPAssoc, const edm::DetSetVector< SimLink > &digiSimLinks, const SimHitRefKeyToIndex &simHitRefKeyToIndex, HitType hitType)
 

Static Private Member Functions

static bool tpHitIndexListLess (const TPHitIndex &i, const TPHitIndex &j)
 
static bool tpHitIndexListLessSort (const TPHitIndex &i, const TPHitIndex &j)
 

Private Attributes

edm::EDGetTokenT< reco::BeamSpotbeamSpotToken_
 
float bsp_sigmax
 
float bsp_sigmay
 
float bsp_sigmaz
 
float bsp_x
 
float bsp_y
 
float bsp_z
 
std::string builderName_
 
edm::EDGetTokenT
< ClusterTPAssociation
clusterTPMapToken_
 
edm::EventNumber_t ev_event
 
edm::LuminosityBlockNumber_t ev_lumi
 
edm::RunNumber_t ev_run
 
std::vector< float > glu_bbxi
 
std::vector< unsigned int > glu_det
 
std::vector< unsigned int > glu_detId
 
std::vector< short > glu_isBarrel
 
std::vector< unsigned int > glu_lay
 
std::vector< int > glu_monoIdx
 
std::vector< float > glu_radL
 
std::vector< std::vector< int > > glu_seeIdx
 
std::vector< int > glu_stereoIdx
 
std::vector< float > glu_x
 
std::vector< float > glu_xx
 
std::vector< float > glu_xy
 
std::vector< float > glu_y
 
std::vector< float > glu_yy
 
std::vector< float > glu_yz
 
std::vector< float > glu_z
 
std::vector< float > glu_zx
 
std::vector< float > glu_zz
 
const bool includeAllHits_
 
const bool includeSeeds_
 
std::vector< unsigned short > inv_det
 
std::vector< unsigned int > inv_detId
 
std::vector< short > inv_isBarrel
 
std::vector< unsigned short > inv_lay
 
std::vector< unsigned short > inv_type
 
std::string parametersDefinerName_
 
std::vector< float > pix_bbxi
 
std::vector< std::vector< float > > pix_chargeFraction
 
std::vector< unsigned short > pix_det
 
std::vector< unsigned int > pix_detId
 
std::vector< short > pix_isBarrel
 
std::vector< unsigned short > pix_lay
 
std::vector< float > pix_radL
 
std::vector< std::vector< int > > pix_seeIdx
 
std::vector< std::vector< int > > pix_simHitIdx
 
std::vector< unsigned short > pix_simType
 
std::vector< std::vector< int > > pix_trkIdx
 
std::vector< float > pix_x
 
std::vector< float > pix_xx
 
std::vector< float > pix_xy
 
std::vector< float > pix_y
 
std::vector< float > pix_yy
 
std::vector< float > pix_yz
 
std::vector< float > pix_z
 
std::vector< float > pix_zx
 
std::vector< float > pix_zz
 
edm::EDGetTokenT
< SiPixelRecHitCollection
pixelRecHitToken_
 
edm::EDGetTokenT
< edm::DetSetVector
< PixelDigiSimLink > > 
pixelSimLinkToken_
 
std::vector< unsigned int > see_algo
 
std::vector< float > see_chi2
 
std::vector< float > see_dxy
 
std::vector< float > see_dxyErr
 
std::vector< float > see_dz
 
std::vector< float > see_dzErr
 
std::vector< float > see_eta
 
std::vector< float > see_etaErr
 
std::vector< short > see_fitok
 
std::vector< std::vector< int > > see_hitIdx
 
std::vector< std::vector< int > > see_hitType
 
std::vector< unsigned int > see_nGlued
 
std::vector< unsigned int > see_nPixel
 
std::vector< unsigned int > see_nStrip
 
std::vector< unsigned int > see_nValid
 
std::vector< unsigned int > see_offset
 
std::vector< float > see_phi
 
std::vector< float > see_phiErr
 
std::vector< float > see_pt
 
std::vector< float > see_ptErr
 
std::vector< float > see_px
 
std::vector< float > see_py
 
std::vector< float > see_pz
 
std::vector< int > see_q
 
std::vector< std::vector< float > > see_shareFrac
 
std::vector< std::vector< int > > see_simTrkIdx
 
std::vector< int > see_trkIdx
 
std::vector< edm::EDGetTokenT
< edm::View< reco::Track > > > 
seedTokens_
 
std::vector< int > sim_bunchCrossing
 
std::vector< std::vector< int > > sim_decayVtxIdx
 
std::vector< float > sim_eta
 
std::vector< int > sim_event
 
std::vector< unsigned int > sim_n3DLay
 
std::vector< unsigned int > sim_nLay
 
std::vector< unsigned int > sim_nPixel
 
std::vector< unsigned int > sim_nPixelLay
 
std::vector< unsigned int > sim_nStrip
 
std::vector< unsigned int > sim_nValid
 
std::vector< int > sim_parentVtxIdx
 
std::vector< float > sim_pca_cotTheta
 
std::vector< float > sim_pca_dxy
 
std::vector< float > sim_pca_dz
 
std::vector< float > sim_pca_eta
 
std::vector< float > sim_pca_lambda
 
std::vector< float > sim_pca_phi
 
std::vector< float > sim_pca_pt
 
std::vector< int > sim_pdgId
 
std::vector< float > sim_phi
 
std::vector< float > sim_pt
 
std::vector< float > sim_px
 
std::vector< float > sim_py
 
std::vector< float > sim_pz
 
std::vector< int > sim_q
 
std::vector< std::vector< float > > sim_shareFrac
 
std::vector< std::vector< int > > sim_simHitIdx
 
std::vector< std::vector< int > > sim_trkIdx
 
std::vector< unsigned short > simhit_det
 
std::vector< unsigned int > simhit_detId
 
std::vector< float > simhit_eloss
 
std::vector< std::vector< int > > simhit_hitIdx
 
std::vector< std::vector< int > > simhit_hitType
 
std::vector< unsigned short > simhit_lay
 
std::vector< int > simhit_particle
 
std::vector< short > simhit_process
 
std::vector< int > simhit_simTrkIdx
 
std::vector< float > simhit_tof
 
std::vector< float > simhit_x
 
std::vector< float > simhit_y
 
std::vector< float > simhit_z
 
edm::EDGetTokenT
< SimHitTPAssociationProducer::SimHitTPAssociationList
simHitTPMapToken_
 
std::vector< int > simpv_idx
 
std::vector< int > simvtx_bunchCrossing
 
std::vector< std::vector< int > > simvtx_daughterSimIdx
 
std::vector< int > simvtx_event
 
std::vector< unsigned int > simvtx_processType
 
std::vector< std::vector< int > > simvtx_sourceSimIdx
 
std::vector< float > simvtx_x
 
std::vector< float > simvtx_y
 
std::vector< float > simvtx_z
 
std::vector< float > str_bbxi
 
std::vector< std::vector< float > > str_chargeFraction
 
std::vector< unsigned short > str_det
 
std::vector< unsigned int > str_detId
 
std::vector< short > str_isBarrel
 
std::vector< short > str_isStereo
 
std::vector< unsigned short > str_lay
 
std::vector< float > str_radL
 
std::vector< std::vector< int > > str_seeIdx
 
std::vector< std::vector< int > > str_simHitIdx
 
std::vector< unsigned short > str_simType
 
std::vector< std::vector< int > > str_trkIdx
 
std::vector< float > str_x
 
std::vector< float > str_xx
 
std::vector< float > str_xy
 
std::vector< float > str_y
 
std::vector< float > str_yy
 
std::vector< float > str_yz
 
std::vector< float > str_z
 
std::vector< float > str_zx
 
std::vector< float > str_zz
 
edm::EDGetTokenT
< SiStripMatchedRecHit2DCollection
stripMatchedRecHitToken_
 
edm::EDGetTokenT
< SiStripRecHit2DCollection
stripRphiRecHitToken_
 
edm::EDGetTokenT
< edm::DetSetVector
< StripDigiSimLink > > 
stripSimLinkToken_
 
edm::EDGetTokenT
< SiStripRecHit2DCollection
stripStereoRecHitToken_
 
TTree * t
 
edm::EDGetTokenT
< edm::ValueMap< unsigned int > > 
tpNLayersToken_
 
edm::EDGetTokenT
< edm::ValueMap< unsigned int > > 
tpNPixelLayersToken_
 
edm::EDGetTokenT
< edm::ValueMap< unsigned int > > 
tpNStripStereoLayersToken_
 
edm::EDGetTokenT
< reco::TrackToTrackingParticleAssociator
trackAssociatorToken_
 
edm::EDGetTokenT
< TrackingParticleRefVector
trackingParticleRefToken_
 
edm::EDGetTokenT
< TrackingParticleCollection
trackingParticleToken_
 
edm::EDGetTokenT
< TrackingVertexCollection
trackingVertexToken_
 
edm::EDGetTokenT< edm::View
< reco::Track > > 
trackToken_
 
std::vector< unsigned int > trk_algo
 
std::vector< decltype(reco::TrackBase().algoMaskUL())> trk_algoMask
 
std::vector< float > trk_cotTheta
 
std::vector< float > trk_dxy
 
std::vector< float > trk_dxyErr
 
std::vector< float > trk_dz
 
std::vector< float > trk_dzErr
 
std::vector< float > trk_eta
 
std::vector< float > trk_etaErr
 
std::vector< std::vector< int > > trk_hitIdx
 
std::vector< std::vector< int > > trk_hitType
 
std::vector< float > trk_inner_pt
 
std::vector< float > trk_inner_px
 
std::vector< float > trk_inner_py
 
std::vector< float > trk_inner_pz
 
std::vector< short > trk_isHP
 
std::vector< float > trk_lambda
 
std::vector< float > trk_lambdaErr
 
std::vector< unsigned int > trk_n3DLay
 
std::vector< float > trk_nChi2
 
std::vector< unsigned int > trk_nInnerLost
 
std::vector< unsigned int > trk_nInvalid
 
std::vector< unsigned int > trk_nOuterLost
 
std::vector< unsigned int > trk_nPixel
 
std::vector< unsigned int > trk_nPixelLay
 
std::vector< unsigned int > trk_nStrip
 
std::vector< unsigned int > trk_nStripLay
 
std::vector< unsigned int > trk_nValid
 
std::vector< unsigned int > trk_originalAlgo
 
std::vector< float > trk_outer_pt
 
std::vector< float > trk_outer_px
 
std::vector< float > trk_outer_py
 
std::vector< float > trk_outer_pz
 
std::vector< float > trk_phi
 
std::vector< float > trk_phiErr
 
std::vector< float > trk_pt
 
std::vector< float > trk_ptErr
 
std::vector< float > trk_px
 
std::vector< float > trk_py
 
std::vector< float > trk_pz
 
std::vector< int > trk_q
 
std::vector< float > trk_refpoint_x
 
std::vector< float > trk_refpoint_y
 
std::vector< float > trk_refpoint_z
 
std::vector< int > trk_seedIdx
 
std::vector< std::vector< float > > trk_shareFrac
 
std::vector< std::vector< int > > trk_simTrkIdx
 
std::vector< unsigned int > trk_stopReason
 
std::vector< int > trk_vtxIdx
 
edm::EDGetTokenT
< reco::VertexCollection
vertexToken_
 
std::vector< float > vtx_chi2
 
std::vector< short > vtx_fake
 
std::vector< float > vtx_ndof
 
std::vector< std::vector< int > > vtx_trkIdx
 
std::vector< short > vtx_valid
 
std::vector< float > vtx_x
 
std::vector< float > vtx_xErr
 
std::vector< float > vtx_y
 
std::vector< float > vtx_yErr
 
std::vector< float > vtx_z
 
std::vector< float > vtx_zErr
 

Additional Inherited Members

- Public Types inherited from edm::one::EDAnalyzerBase
typedef EDAnalyzerBase ModuleType
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- Protected Member Functions inherited from edm::EDConsumerBase
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken consumes (TypeToGet const &id, edm::InputTag const &tag)
 
ConsumesCollector consumesCollector ()
 Use a ConsumesCollector to gather consumes information from helper functions. More...
 
template<typename ProductType , BranchType B = InEvent>
void consumesMany ()
 
void consumesMany (const TypeToGet &id)
 
template<BranchType B>
void consumesMany (const TypeToGet &id)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 

Detailed Description

Description: [one line class summary]

Implementation: [Notes on implementation]

Definition at line 246 of file TrackingNtuple.cc.

Member Typedef Documentation

Definition at line 264 of file TrackingNtuple.cc.

typedef std::map<SimHitFullKey, size_t> TrackingNtuple::SimHitRefKeyToIndex
private

Definition at line 265 of file TrackingNtuple.cc.

Definition at line 261 of file TrackingNtuple.cc.

Definition at line 262 of file TrackingNtuple.cc.

Definition at line 263 of file TrackingNtuple.cc.

Member Enumeration Documentation

enum TrackingNtuple::HitSimType
strongprivate
Enumerator
Signal 
ITPileup 
OOTPileup 
Noise 
Unknown 

Definition at line 279 of file TrackingNtuple.cc.

279  {
280  Signal = 0,
281  ITPileup = 1,
282  OOTPileup = 2,
283  Noise = 3,
284  Unknown = 99
285  };
Definition: vlib.h:39
enum TrackingNtuple::HitType
strongprivate
Enumerator
Pixel 
Strip 
Glued 
Invalid 
Unknown 

Definition at line 267 of file TrackingNtuple.cc.

267  {
268  Pixel = 0,
269  Strip = 1,
270  Glued = 2,
271  Invalid = 3,
272  Unknown = 99
273  };

Constructor & Destructor Documentation

TrackingNtuple::TrackingNtuple ( const edm::ParameterSet iConfig)
explicit

Definition at line 681 of file TrackingNtuple.cc.

References GlobalPosition_Frontier_DevDB_cff::tag.

681  :
682  seedTokens_(edm::vector_transform(iConfig.getUntrackedParameter<std::vector<edm::InputTag> >("seedTracks"), [&](const edm::InputTag& tag) {
683  return consumes<edm::View<reco::Track> >(tag);
684  })),
T getUntrackedParameter(std::string const &, T const &) const
auto vector_transform(std::vector< InputType > const &input, Function predicate) -> std::vector< typename std::remove_cv< typename std::remove_reference< decltype(predicate(input.front()))>::type >::type >
Definition: transform.h:11
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
std::vector< edm::EDGetTokenT< edm::View< reco::Track > > > seedTokens_
TrackingNtuple::~TrackingNtuple ( )

Definition at line 970 of file TrackingNtuple.cc.

970  {
971  // do anything here that needs to be done at desctruction time
972  // (e.g. close files, deallocate resources etc.)
973 }

Member Function Documentation

void TrackingNtuple::analyze ( const edm::Event iEvent,
const edm::EventSetup iSetup 
)
overrideprivatevirtual

Implements edm::one::EDAnalyzerBase.

Definition at line 1210 of file TrackingNtuple.cc.

References beamSpotToken_, builderName_, EncodedEventId::bunchCrossing(), clearVariables(), clusterTPMapToken_, ev_event, ev_lumi, ev_run, edm::EventID::event(), TrackingVertex::eventId(), fillBeamSpot(), fillPixelHits(), fillSeeds(), fillSimHits(), fillStripMatchedHits(), fillStripRphiStereoHits(), fillTrackingParticles(), fillTrackingVertices(), fillTracks(), fillVertices(), edm::EventSetup::get(), edm::Event::getByToken(), i, edm::EventBase::id(), includeAllHits_, includeSeeds_, edm::EDGetTokenT< T >::isUninitialized(), LogDebug, edm::EventID::luminosityBlock(), pixelSimLinkToken_, edm::RefToBaseVector< T >::push_back(), dt_dqm_sourceclient_common_cff::reco, edm::EventID::run(), simHitTPMapToken_, findQualityFiles::size, stripSimLinkToken_, t, tpHitIndexListLessSort(), trackAssociatorToken_, patCandidatesForDimuonsSequences_cff::tracker, trackingParticleRefToken_, trackingParticleToken_, trackingVertexToken_, testEve_cfg::tracks, trackToken_, findQualityFiles::v, vertexToken_, and HLT_25ns10e33_v2_cff::vertices.

1210  {
1211 
1212  using namespace edm;
1213  using namespace reco;
1214  using namespace std;
1215 
1217  iSetup.get<IdealMagneticFieldRecord>().get(theMF);
1218 
1220  iSetup.get<TransientRecHitRecord>().get(builderName_,theTTRHBuilder);
1221 
1222  edm::ESHandle<TrackerTopology> tTopoHandle;
1223  iSetup.get<TrackerTopologyRcd>().get(tTopoHandle);
1224  const TrackerTopology& tTopo = *tTopoHandle;
1225 
1226  edm::ESHandle<TrackerGeometry> geometryHandle;
1227  iSetup.get<TrackerDigiGeometryRecord>().get(geometryHandle);
1228  const TrackerGeometry &tracker = *geometryHandle;
1229 
1231  iEvent.getByToken(trackAssociatorToken_, theAssociator);
1232  const reco::TrackToTrackingParticleAssociator& associatorByHits = *theAssociator;
1233 
1234  LogDebug("TrackingNtuple") << "Analyzing new event";
1235 
1236  //initialize tree variables
1237  clearVariables();
1238 
1239  // FIXME: we really need to move to edm::View for reading the
1240  // TrackingParticles... Unfortunately it has non-trivial
1241  // consequences on the associator/association interfaces etc.
1243  TrackingParticleRefKeySet tmpTPkeys;
1244  const TrackingParticleRefVector *tmpTPptr = nullptr;
1246  edm::Handle<TrackingParticleRefVector> TPCollectionHRefVector;
1247 
1249  iEvent.getByToken(trackingParticleToken_, TPCollectionH);
1250  for(size_t i=0, size=TPCollectionH->size(); i<size; ++i) {
1251  tmpTP.push_back(TrackingParticleRef(TPCollectionH, i));
1252  }
1253  tmpTPptr = &tmpTP;
1254  }
1255  else {
1256  iEvent.getByToken(trackingParticleRefToken_, TPCollectionHRefVector);
1257  tmpTPptr = TPCollectionHRefVector.product();
1258  for(const auto& ref: *tmpTPptr) {
1259  tmpTPkeys.insert(ref.key());
1260  }
1261  }
1262  const TrackingParticleRefVector& tpCollection = *tmpTPptr;
1263 
1264  // Fill mapping from Ref::key() to index
1265  TrackingParticleRefKeyToIndex tpKeyToIndex;
1266  for(size_t i=0; i<tpCollection.size(); ++i) {
1267  tpKeyToIndex[tpCollection[i].key()] = i;
1268  }
1269 
1270  // tracking vertices
1272  iEvent.getByToken(trackingVertexToken_, htv);
1273  const TrackingVertexCollection& tvs = *htv;
1274 
1275  // Fill mapping from Ref::key() to index
1276  TrackingVertexRefVector tvRefs;
1277  TrackingVertexRefKeyToIndex tvKeyToIndex;
1278  for(size_t i=0; i<tvs.size(); ++i) {
1279  const TrackingVertex& v = tvs[i];
1280  if(v.eventId().bunchCrossing() != 0) // Ignore OOTPU; would be better to not to hardcode?
1281  continue;
1282  tvKeyToIndex[i] = tvRefs.size();
1283  tvRefs.push_back(TrackingVertexRef(htv, i));
1284  }
1285 
1286  //get association maps, etc.
1287  Handle<ClusterTPAssociation> pCluster2TPListH;
1288  iEvent.getByToken(clusterTPMapToken_, pCluster2TPListH);
1289  const ClusterTPAssociation& clusterToTPMap = *pCluster2TPListH;
1291  iEvent.getByToken(simHitTPMapToken_, simHitsTPAssoc);
1292 
1293  // SimHit key -> index mapping
1294  SimHitRefKeyToIndex simHitRefKeyToIndex;
1295 
1296  //make a list to link TrackingParticles to its simhits
1297  std::vector<TPHitIndex> tpHitList;
1298 
1299  std::set<edm::ProductID> hitProductIds;
1300  std::map<edm::ProductID, size_t> seedCollToOffset;
1301 
1302  ev_run = iEvent.id().run();
1303  ev_lumi = iEvent.id().luminosityBlock();
1304  ev_event = iEvent.id().event();
1305 
1306  // Digi->Sim links for pixels and strips
1307  edm::Handle<edm::DetSetVector<PixelDigiSimLink> > pixelDigiSimLinksHandle;
1308  iEvent.getByToken(pixelSimLinkToken_, pixelDigiSimLinksHandle);
1309  const auto& pixelDigiSimLinks = *pixelDigiSimLinksHandle;
1310 
1311  edm::Handle<edm::DetSetVector<StripDigiSimLink> > stripDigiSimLinksHandle;
1312  iEvent.getByToken(stripSimLinkToken_, stripDigiSimLinksHandle);
1313  const auto& stripDigiSimLinks = *stripDigiSimLinksHandle;
1314 
1315  //beamspot
1316  Handle<reco::BeamSpot> recoBeamSpotHandle;
1317  iEvent.getByToken(beamSpotToken_, recoBeamSpotHandle);
1318  BeamSpot const & bs = *recoBeamSpotHandle;
1319  fillBeamSpot(bs);
1320 
1321  //prapare list to link matched hits to collection
1322  vector<pair<int,int> > monoStereoClusterList;
1323  if(includeAllHits_) {
1324  // simhits
1325  fillSimHits(tracker, tpKeyToIndex, *simHitsTPAssoc, tTopo, simHitRefKeyToIndex, tpHitList);
1326 
1327  //pixel hits
1328  fillPixelHits(iEvent, clusterToTPMap, tpKeyToIndex, *simHitsTPAssoc, pixelDigiSimLinks, *theTTRHBuilder, tTopo, simHitRefKeyToIndex, hitProductIds);
1329 
1330  //strip hits
1331  fillStripRphiStereoHits(iEvent, clusterToTPMap, tpKeyToIndex, *simHitsTPAssoc, stripDigiSimLinks, *theTTRHBuilder, tTopo, simHitRefKeyToIndex, hitProductIds);
1332 
1333  //matched hits
1334  fillStripMatchedHits(iEvent, *theTTRHBuilder, tTopo, monoStereoClusterList);
1335  }
1336 
1337  //seeds
1338  if(includeSeeds_) {
1339  fillSeeds(iEvent, tpCollection, tpKeyToIndex, bs, associatorByHits, *theTTRHBuilder, theMF.product(), monoStereoClusterList, hitProductIds, seedCollToOffset);
1340  }
1341 
1342  //tracks
1343  edm::Handle<edm::View<reco::Track> > tracksHandle;
1344  iEvent.getByToken(trackToken_, tracksHandle);
1345  const edm::View<reco::Track>& tracks = *tracksHandle;
1346  // The associator interfaces really need to be fixed...
1348  for(edm::View<Track>::size_type i=0; i<tracks.size(); ++i) {
1349  trackRefs.push_back(tracks.refAt(i));
1350  }
1351  fillTracks(trackRefs, tpCollection, tpKeyToIndex, bs, associatorByHits, *theTTRHBuilder, tTopo, hitProductIds, seedCollToOffset);
1352 
1353  //tracking particles
1354  //sort association maps with simHits
1355  std::sort( tpHitList.begin(), tpHitList.end(), tpHitIndexListLessSort );
1356  fillTrackingParticles(iEvent, iSetup, trackRefs, tpCollection, tvKeyToIndex, associatorByHits, tpHitList);
1357 
1358  // vertices
1360  iEvent.getByToken(vertexToken_, vertices);
1361  fillVertices(*vertices, trackRefs);
1362 
1363  // tracking vertices
1364  fillTrackingVertices(tvRefs, tpKeyToIndex);
1365 
1366  t->Fill();
1367 
1368 }
#define LogDebug(id)
RunNumber_t run() const
Definition: EventID.h:39
edm::LuminosityBlockNumber_t ev_lumi
edm::EDGetTokenT< TrackingParticleRefVector > trackingParticleRefToken_
EventNumber_t event() const
Definition: EventID.h:41
unsigned int size_type
Definition: View.h:85
void fillTrackingVertices(const TrackingVertexRefVector &trackingVertices, const TrackingParticleRefKeyToIndex &tpKeyToIndex)
int i
Definition: DBlmapReader.cc:9
std::unordered_map< reco::RecoToSimCollection::index_type, size_t > TrackingParticleRefKeyToIndex
void fillStripMatchedHits(const edm::Event &iEvent, const TransientTrackingRecHitBuilder &theTTRHBuilder, const TrackerTopology &tTopo, std::vector< std::pair< int, int > > &monoStereoClusterList)
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:457
void fillPixelHits(const edm::Event &iEvent, const ClusterTPAssociation &clusterToTPMap, const TrackingParticleRefKeyToIndex &tpKeyToIndex, const SimHitTPAssociationProducer::SimHitTPAssociationList &simHitsTPAssoc, const edm::DetSetVector< PixelDigiSimLink > &digiSimLink, const TransientTrackingRecHitBuilder &theTTRHBuilder, const TrackerTopology &tTopo, const SimHitRefKeyToIndex &simHitRefKeyToIndex, std::set< edm::ProductID > &hitProductIds)
void fillStripRphiStereoHits(const edm::Event &iEvent, const ClusterTPAssociation &clusterToTPMap, const TrackingParticleRefKeyToIndex &tpKeyToIndex, const SimHitTPAssociationProducer::SimHitTPAssociationList &simHitsTPAssoc, const edm::DetSetVector< StripDigiSimLink > &digiSimLink, const TransientTrackingRecHitBuilder &theTTRHBuilder, const TrackerTopology &tTopo, const SimHitRefKeyToIndex &simHitRefKeyToIndex, std::set< edm::ProductID > &hitProductIds)
edm::EDGetTokenT< reco::TrackToTrackingParticleAssociator > trackAssociatorToken_
edm::EDGetTokenT< edm::View< reco::Track > > trackToken_
void fillBeamSpot(const reco::BeamSpot &bs)
void fillTracks(const edm::RefToBaseVector< reco::Track > &tracks, const TrackingParticleRefVector &tpCollection, const TrackingParticleRefKeyToIndex &tpKeyToIndex, const reco::BeamSpot &bs, const reco::TrackToTrackingParticleAssociator &associatorByHits, const TransientTrackingRecHitBuilder &theTTRHBuilder, const TrackerTopology &tTopo, const std::set< edm::ProductID > &hitProductIds, const std::map< edm::ProductID, size_t > &seedToCollIndex)
TrackingParticleRefKeyToIndex TrackingVertexRefKeyToIndex
void fillTrackingParticles(const edm::Event &iEvent, const edm::EventSetup &iSetup, const edm::RefToBaseVector< reco::Track > &tracks, const TrackingParticleRefVector &tpCollection, const TrackingVertexRefKeyToIndex &tvKeyToIndex, const reco::TrackToTrackingParticleAssociator &associatorByHits, const std::vector< TPHitIndex > &tpHitList)
LuminosityBlockNumber_t luminosityBlock() const
Definition: EventID.h:40
edm::EDGetTokenT< edm::DetSetVector< PixelDigiSimLink > > pixelSimLinkToken_
int bunchCrossing() const
get the detector field from this detid
edm::EDGetTokenT< SimHitTPAssociationProducer::SimHitTPAssociationList > simHitTPMapToken_
edm::RunNumber_t ev_run
edm::EDGetTokenT< TrackingVertexCollection > trackingVertexToken_
static bool tpHitIndexListLessSort(const TPHitIndex &i, const TPHitIndex &j)
const bool includeSeeds_
void fillSimHits(const TrackerGeometry &tracker, const TrackingParticleRefKeyToIndex &tpKeyToIndex, const SimHitTPAssociationProducer::SimHitTPAssociationList &simHitsTPAssoc, const TrackerTopology &tTopo, SimHitRefKeyToIndex &simHitRefKeyToIndex, std::vector< TPHitIndex > &tpHitList)
edm::Ref< TrackingVertexCollection > TrackingVertexRef
edm::EventNumber_t ev_event
edm::EDGetTokenT< reco::VertexCollection > vertexToken_
edm::EDGetTokenT< TrackingParticleCollection > trackingParticleToken_
tuple tracks
Definition: testEve_cfg.py:39
std::vector< TrackingVertex > TrackingVertexCollection
const T & get() const
Definition: EventSetup.h:56
const bool includeAllHits_
edm::EventID id() const
Definition: EventBase.h:58
const EncodedEventId & eventId() const
edm::EDGetTokenT< ClusterTPAssociation > clusterTPMapToken_
void push_back(const RefToBase< T > &)
std::map< SimHitFullKey, size_t > SimHitRefKeyToIndex
edm::EDGetTokenT< reco::BeamSpot > beamSpotToken_
std::string builderName_
bool isUninitialized() const
Definition: EDGetToken.h:73
void fillVertices(const reco::VertexCollection &vertices, const edm::RefToBaseVector< reco::Track > &tracks)
std::unordered_set< reco::RecoToSimCollection::index_type > TrackingParticleRefKeySet
tuple size
Write out results.
edm::Ref< TrackingParticleCollection > TrackingParticleRef
void fillSeeds(const edm::Event &iEvent, const TrackingParticleRefVector &tpCollection, const TrackingParticleRefKeyToIndex &tpKeyToIndex, const reco::BeamSpot &bs, const reco::TrackToTrackingParticleAssociator &associatorByHits, const TransientTrackingRecHitBuilder &theTTRHBuilder, const MagneticField *theMF, const std::vector< std::pair< int, int > > &monoStereoClusterList, const std::set< edm::ProductID > &hitProductIds, std::map< edm::ProductID, size_t > &seedToCollIndex)
edm::EDGetTokenT< edm::DetSetVector< StripDigiSimLink > > stripSimLinkToken_
void TrackingNtuple::clearVariables ( )
private

Definition at line 979 of file TrackingNtuple.cc.

References bsp_sigmax, bsp_sigmay, bsp_sigmaz, bsp_x, bsp_y, bsp_z, ev_event, ev_lumi, ev_run, glu_bbxi, glu_det, glu_detId, glu_isBarrel, glu_lay, glu_monoIdx, glu_radL, glu_seeIdx, glu_stereoIdx, glu_x, glu_xx, glu_xy, glu_y, glu_yy, glu_yz, glu_z, glu_zx, glu_zz, inv_det, inv_detId, inv_isBarrel, inv_lay, inv_type, pix_bbxi, pix_chargeFraction, pix_det, pix_detId, pix_isBarrel, pix_lay, pix_radL, pix_seeIdx, pix_simHitIdx, pix_simType, pix_trkIdx, pix_x, pix_xx, pix_xy, pix_y, pix_yy, pix_yz, pix_z, pix_zx, pix_zz, see_algo, see_chi2, see_dxy, see_dxyErr, see_dz, see_dzErr, see_eta, see_etaErr, see_fitok, see_hitIdx, see_hitType, see_nGlued, see_nPixel, see_nStrip, see_nValid, see_offset, see_phi, see_phiErr, see_pt, see_ptErr, see_px, see_py, see_pz, see_q, see_shareFrac, see_simTrkIdx, see_trkIdx, sim_bunchCrossing, sim_decayVtxIdx, sim_eta, sim_event, sim_n3DLay, sim_nLay, sim_nPixel, sim_nPixelLay, sim_nStrip, sim_nValid, sim_parentVtxIdx, sim_pca_cotTheta, sim_pca_dxy, sim_pca_dz, sim_pca_eta, sim_pca_lambda, sim_pca_phi, sim_pca_pt, sim_pdgId, sim_phi, sim_pt, sim_px, sim_py, sim_pz, sim_q, sim_shareFrac, sim_simHitIdx, sim_trkIdx, simhit_det, simhit_detId, simhit_eloss, simhit_hitIdx, simhit_hitType, simhit_lay, simhit_particle, simhit_process, simhit_simTrkIdx, simhit_tof, simhit_x, simhit_y, simhit_z, simpv_idx, simvtx_bunchCrossing, simvtx_daughterSimIdx, simvtx_event, simvtx_sourceSimIdx, simvtx_x, simvtx_y, simvtx_z, str_bbxi, str_chargeFraction, str_det, str_detId, str_isBarrel, str_isStereo, str_lay, str_radL, str_seeIdx, str_simHitIdx, str_simType, str_trkIdx, str_x, str_xx, str_xy, str_y, str_yy, str_yz, str_z, str_zx, str_zz, trk_algo, trk_algoMask, trk_cotTheta, trk_dxy, trk_dxyErr, trk_dz, trk_dzErr, trk_eta, trk_etaErr, trk_hitIdx, trk_hitType, trk_inner_pt, trk_inner_px, trk_inner_py, trk_inner_pz, trk_isHP, trk_lambda, trk_lambdaErr, trk_n3DLay, trk_nChi2, trk_nInnerLost, trk_nInvalid, trk_nOuterLost, trk_nPixel, trk_nPixelLay, trk_nStrip, trk_nStripLay, trk_nValid, trk_originalAlgo, trk_outer_pt, trk_outer_px, trk_outer_py, trk_outer_pz, trk_phi, trk_phiErr, trk_pt, trk_ptErr, trk_px, trk_py, trk_pz, trk_q, trk_refpoint_x, trk_refpoint_y, trk_refpoint_z, trk_seedIdx, trk_shareFrac, trk_simTrkIdx, trk_stopReason, trk_vtxIdx, vtx_chi2, vtx_fake, vtx_ndof, vtx_trkIdx, vtx_valid, vtx_x, vtx_xErr, vtx_y, vtx_yErr, vtx_z, and vtx_zErr.

Referenced by analyze().

979  {
980 
981  ev_run = 0;
982  ev_lumi = 0;
983  ev_event = 0;
984 
985  //tracks
986  trk_px .clear();
987  trk_py .clear();
988  trk_pz .clear();
989  trk_pt .clear();
990  trk_inner_px .clear();
991  trk_inner_py .clear();
992  trk_inner_pz .clear();
993  trk_inner_pt .clear();
994  trk_outer_px .clear();
995  trk_outer_py .clear();
996  trk_outer_pz .clear();
997  trk_outer_pt .clear();
998  trk_eta .clear();
999  trk_lambda .clear();
1000  trk_cotTheta .clear();
1001  trk_phi .clear();
1002  trk_dxy .clear();
1003  trk_dz .clear();
1004  trk_ptErr .clear();
1005  trk_etaErr .clear();
1006  trk_lambdaErr.clear();
1007  trk_phiErr .clear();
1008  trk_dxyErr .clear();
1009  trk_dzErr .clear();
1010  trk_refpoint_x.clear();
1011  trk_refpoint_y.clear();
1012  trk_refpoint_z.clear();
1013  trk_nChi2 .clear();
1014  trk_q .clear();
1015  trk_nValid .clear();
1016  trk_nInvalid .clear();
1017  trk_nPixel .clear();
1018  trk_nStrip .clear();
1019  trk_nPixelLay.clear();
1020  trk_nStripLay.clear();
1021  trk_n3DLay .clear();
1022  trk_nOuterLost.clear();
1023  trk_nInnerLost.clear();
1024  trk_algo .clear();
1025  trk_originalAlgo.clear();
1026  trk_algoMask .clear();
1027  trk_stopReason.clear();
1028  trk_isHP .clear();
1029  trk_seedIdx .clear();
1030  trk_vtxIdx .clear();
1031  trk_shareFrac.clear();
1032  trk_simTrkIdx.clear();
1033  trk_hitIdx .clear();
1034  trk_hitType .clear();
1035  //sim tracks
1036  sim_event .clear();
1037  sim_bunchCrossing.clear();
1038  sim_pdgId .clear();
1039  sim_px .clear();
1040  sim_py .clear();
1041  sim_pz .clear();
1042  sim_pt .clear();
1043  sim_eta .clear();
1044  sim_phi .clear();
1045  sim_pca_pt .clear();
1046  sim_pca_eta .clear();
1047  sim_pca_lambda.clear();
1048  sim_pca_cotTheta.clear();
1049  sim_pca_phi .clear();
1050  sim_pca_dxy .clear();
1051  sim_pca_dz .clear();
1052  sim_q .clear();
1053  sim_nValid .clear();
1054  sim_nPixel .clear();
1055  sim_nStrip .clear();
1056  sim_nLay .clear();
1057  sim_nPixelLay.clear();
1058  sim_n3DLay .clear();
1059  sim_trkIdx .clear();
1060  sim_shareFrac.clear();
1061  sim_parentVtxIdx.clear();
1062  sim_decayVtxIdx.clear();
1063  sim_simHitIdx .clear();
1064  //pixels
1065  pix_isBarrel .clear();
1066  pix_det .clear();
1067  pix_lay .clear();
1068  pix_detId .clear();
1069  pix_trkIdx .clear();
1070  pix_seeIdx .clear();
1071  pix_simHitIdx.clear();
1072  pix_chargeFraction.clear();
1073  pix_simType.clear();
1074  pix_x .clear();
1075  pix_y .clear();
1076  pix_z .clear();
1077  pix_xx .clear();
1078  pix_xy .clear();
1079  pix_yy .clear();
1080  pix_yz .clear();
1081  pix_zz .clear();
1082  pix_zx .clear();
1083  pix_radL .clear();
1084  pix_bbxi .clear();
1085  //strips
1086  str_isBarrel .clear();
1087  str_isStereo .clear();
1088  str_det .clear();
1089  str_lay .clear();
1090  str_detId .clear();
1091  str_trkIdx .clear();
1092  str_seeIdx .clear();
1093  str_simHitIdx.clear();
1094  str_chargeFraction.clear();
1095  str_simType.clear();
1096  str_x .clear();
1097  str_y .clear();
1098  str_z .clear();
1099  str_xx .clear();
1100  str_xy .clear();
1101  str_yy .clear();
1102  str_yz .clear();
1103  str_zz .clear();
1104  str_zx .clear();
1105  str_radL .clear();
1106  str_bbxi .clear();
1107  //matched hits
1108  glu_isBarrel .clear();
1109  glu_det .clear();
1110  glu_lay .clear();
1111  glu_detId .clear();
1112  glu_monoIdx .clear();
1113  glu_stereoIdx.clear();
1114  glu_seeIdx .clear();
1115  glu_x .clear();
1116  glu_y .clear();
1117  glu_z .clear();
1118  glu_xx .clear();
1119  glu_xy .clear();
1120  glu_yy .clear();
1121  glu_yz .clear();
1122  glu_zz .clear();
1123  glu_zx .clear();
1124  glu_radL .clear();
1125  glu_bbxi .clear();
1126  //invalid hits
1127  inv_isBarrel .clear();
1128  inv_det .clear();
1129  inv_lay .clear();
1130  inv_detId .clear();
1131  inv_type .clear();
1132  // simhits
1133  simhit_det.clear();
1134  simhit_lay.clear();
1135  simhit_detId.clear();
1136  simhit_x.clear();
1137  simhit_y.clear();
1138  simhit_z.clear();
1139  simhit_particle.clear();
1140  simhit_process.clear();
1141  simhit_eloss.clear();
1142  simhit_tof.clear();
1143  //simhit_simTrackId.clear();
1144  simhit_simTrkIdx.clear();
1145  simhit_hitIdx.clear();
1146  simhit_hitType.clear();
1147  //beamspot
1148  bsp_x = -9999.;
1149  bsp_y = -9999.;
1150  bsp_z = -9999.;
1151  bsp_sigmax = -9999.;
1152  bsp_sigmay = -9999.;
1153  bsp_sigmaz = -9999.;
1154  //seeds
1155  see_fitok .clear();
1156  see_px .clear();
1157  see_py .clear();
1158  see_pz .clear();
1159  see_pt .clear();
1160  see_eta .clear();
1161  see_phi .clear();
1162  see_dxy .clear();
1163  see_dz .clear();
1164  see_ptErr .clear();
1165  see_etaErr .clear();
1166  see_phiErr .clear();
1167  see_dxyErr .clear();
1168  see_dzErr .clear();
1169  see_chi2 .clear();
1170  see_q .clear();
1171  see_nValid .clear();
1172  see_nPixel .clear();
1173  see_nGlued .clear();
1174  see_nStrip .clear();
1175  see_algo .clear();
1176  see_trkIdx .clear();
1177  see_shareFrac.clear();
1178  see_simTrkIdx.clear();
1179  see_hitIdx .clear();
1180  see_hitType .clear();
1181  //seed algo offset
1182  see_offset.clear();
1183 
1184  // vertices
1185  vtx_x.clear();
1186  vtx_y.clear();
1187  vtx_z.clear();
1188  vtx_xErr.clear();
1189  vtx_yErr.clear();
1190  vtx_zErr.clear();
1191  vtx_ndof.clear();
1192  vtx_chi2.clear();
1193  vtx_fake.clear();
1194  vtx_valid.clear();
1195  vtx_trkIdx.clear();
1196 
1197  // Tracking vertices
1198  simvtx_event.clear();
1199  simvtx_bunchCrossing.clear();
1200  simvtx_x.clear();
1201  simvtx_y.clear();
1202  simvtx_z.clear();
1203  simvtx_sourceSimIdx.clear();
1204  simvtx_daughterSimIdx.clear();
1205  simpv_idx.clear();
1206 }
std::vector< unsigned short > str_lay
std::vector< float > sim_pca_dz
edm::LuminosityBlockNumber_t ev_lumi
std::vector< unsigned int > sim_nLay
std::vector< short > see_fitok
std::vector< short > vtx_fake
std::vector< float > simvtx_z
std::vector< std::vector< int > > see_hitType
std::vector< float > trk_phi
std::vector< float > sim_pca_cotTheta
std::vector< float > sim_pca_dxy
std::vector< unsigned int > trk_nOuterLost
std::vector< float > glu_xy
std::vector< float > glu_radL
std::vector< float > trk_inner_pz
std::vector< float > pix_y
std::vector< int > trk_vtxIdx
std::vector< std::vector< int > > str_trkIdx
std::vector< unsigned int > see_nValid
std::vector< float > str_yy
std::vector< float > trk_outer_py
std::vector< float > pix_zz
std::vector< int > glu_monoIdx
std::vector< float > trk_eta
std::vector< short > glu_isBarrel
std::vector< int > sim_bunchCrossing
std::vector< unsigned int > glu_lay
std::vector< float > see_phiErr
std::vector< std::vector< int > > simhit_hitIdx
std::vector< unsigned short > inv_lay
std::vector< float > str_x
std::vector< float > see_dzErr
std::vector< unsigned int > sim_n3DLay
std::vector< float > trk_cotTheta
std::vector< unsigned int > see_nStrip
std::vector< float > trk_px
std::vector< unsigned short > pix_simType
std::vector< unsigned short > inv_type
std::vector< float > pix_zx
std::vector< float > sim_phi
std::vector< std::vector< int > > trk_simTrkIdx
std::vector< float > trk_dxyErr
std::vector< float > str_yz
std::vector< float > trk_pt
std::vector< float > glu_x
std::vector< unsigned int > glu_det
std::vector< float > trk_inner_py
std::vector< float > see_px
std::vector< float > see_chi2
std::vector< float > glu_z
std::vector< float > trk_outer_px
std::vector< std::vector< int > > trk_hitType
std::vector< unsigned int > see_algo
std::vector< float > trk_inner_pt
std::vector< short > simhit_process
std::vector< std::vector< int > > str_seeIdx
std::vector< std::vector< int > > see_simTrkIdx
std::vector< int > simvtx_event
std::vector< float > str_radL
std::vector< unsigned short > simhit_det
std::vector< unsigned int > inv_detId
std::vector< int > simhit_simTrkIdx
std::vector< std::vector< float > > sim_shareFrac
std::vector< short > str_isStereo
std::vector< float > sim_py
std::vector< float > sim_px
std::vector< float > pix_xx
std::vector< std::vector< int > > sim_decayVtxIdx
std::vector< float > trk_refpoint_x
std::vector< float > pix_radL
std::vector< float > pix_bbxi
std::vector< int > simpv_idx
std::vector< unsigned int > trk_stopReason
std::vector< std::vector< int > > pix_seeIdx
std::vector< unsigned short > str_simType
std::vector< int > sim_q
std::vector< short > inv_isBarrel
std::vector< float > see_etaErr
std::vector< float > simhit_z
std::vector< float > trk_refpoint_y
std::vector< int > sim_event
std::vector< unsigned int > trk_nStrip
std::vector< unsigned int > trk_nPixel
std::vector< float > glu_y
std::vector< float > trk_pz
std::vector< float > trk_dzErr
std::vector< float > trk_lambdaErr
std::vector< unsigned short > pix_lay
std::vector< std::vector< int > > simvtx_sourceSimIdx
std::vector< float > trk_etaErr
std::vector< short > pix_isBarrel
std::vector< float > glu_yz
std::vector< float > sim_pca_phi
std::vector< unsigned int > trk_algo
std::vector< float > vtx_y
std::vector< float > pix_z
std::vector< float > sim_eta
std::vector< unsigned int > trk_originalAlgo
std::vector< unsigned int > trk_nInnerLost
std::vector< float > str_y
std::vector< unsigned short > pix_det
std::vector< int > sim_pdgId
std::vector< int > see_q
std::vector< std::vector< int > > simhit_hitType
std::vector< float > trk_refpoint_z
std::vector< float > pix_yz
std::vector< int > trk_seedIdx
std::vector< std::vector< float > > pix_chargeFraction
edm::RunNumber_t ev_run
std::vector< float > vtx_yErr
std::vector< std::vector< int > > pix_trkIdx
std::vector< unsigned int > sim_nValid
std::vector< float > glu_yy
std::vector< float > vtx_ndof
std::vector< float > simvtx_x
std::vector< float > str_zz
std::vector< float > sim_pca_pt
std::vector< float > see_dxyErr
std::vector< float > see_pt
std::vector< float > see_dxy
std::vector< std::vector< int > > glu_seeIdx
std::vector< unsigned int > trk_n3DLay
std::vector< std::vector< int > > sim_trkIdx
std::vector< float > trk_outer_pt
std::vector< float > trk_dz
std::vector< float > trk_ptErr
std::vector< unsigned int > simhit_detId
std::vector< unsigned int > trk_nStripLay
std::vector< float > see_phi
std::vector< float > vtx_z
std::vector< float > see_pz
std::vector< float > trk_phiErr
std::vector< unsigned int > sim_nPixelLay
std::vector< float > trk_lambda
std::vector< float > glu_zz
std::vector< float > sim_pca_lambda
std::vector< float > glu_zx
std::vector< float > vtx_xErr
std::vector< std::vector< float > > trk_shareFrac
std::vector< float > sim_pz
std::vector< std::vector< int > > sim_simHitIdx
std::vector< unsigned short > inv_det
edm::EventNumber_t ev_event
std::vector< int > glu_stereoIdx
std::vector< unsigned short > simhit_lay
std::vector< float > trk_py
std::vector< std::vector< int > > pix_simHitIdx
std::vector< float > trk_nChi2
std::vector< unsigned short > str_det
std::vector< unsigned int > see_nGlued
std::vector< float > see_py
std::vector< float > pix_x
std::vector< int > sim_parentVtxIdx
std::vector< float > see_ptErr
std::vector< float > str_z
std::vector< float > str_zx
std::vector< short > trk_isHP
std::vector< float > str_xy
std::vector< std::vector< float > > str_chargeFraction
std::vector< std::vector< int > > trk_hitIdx
std::vector< std::vector< float > > see_shareFrac
std::vector< int > trk_q
std::vector< unsigned int > sim_nPixel
std::vector< short > vtx_valid
std::vector< std::vector< int > > vtx_trkIdx
std::vector< short > str_isBarrel
std::vector< float > glu_bbxi
std::vector< int > simhit_particle
std::vector< float > trk_outer_pz
std::vector< float > sim_pca_eta
std::vector< float > simhit_y
std::vector< std::vector< int > > str_simHitIdx
std::vector< float > glu_xx
std::vector< unsigned int > trk_nPixelLay
std::vector< float > simhit_x
std::vector< float > simvtx_y
std::vector< std::vector< int > > simvtx_daughterSimIdx
std::vector< float > str_xx
std::vector< unsigned int > see_offset
std::vector< int > see_trkIdx
std::vector< float > simhit_tof
std::vector< float > pix_xy
std::vector< float > trk_dxy
std::vector< float > sim_pt
std::vector< float > pix_yy
std::vector< unsigned int > trk_nInvalid
std::vector< decltype(reco::TrackBase().algoMaskUL())> trk_algoMask
std::vector< std::vector< int > > see_hitIdx
std::vector< float > vtx_x
std::vector< unsigned int > see_nPixel
std::vector< float > see_eta
std::vector< unsigned int > trk_nValid
std::vector< float > trk_inner_px
std::vector< float > vtx_zErr
std::vector< unsigned int > pix_detId
std::vector< float > simhit_eloss
std::vector< float > vtx_chi2
std::vector< int > simvtx_bunchCrossing
std::vector< float > str_bbxi
std::vector< float > see_dz
std::vector< unsigned int > glu_detId
std::vector< unsigned int > sim_nStrip
std::vector< unsigned int > str_detId
void TrackingNtuple::fillBeamSpot ( const reco::BeamSpot bs)
private

Definition at line 1370 of file TrackingNtuple.cc.

References reco::BeamSpot::BeamWidthX(), reco::BeamSpot::BeamWidthY(), bsp_sigmax, bsp_sigmay, bsp_sigmaz, bsp_x, bsp_y, bsp_z, reco::BeamSpot::sigmaZ(), reco::BeamSpot::x0(), and reco::BeamSpot::y0().

Referenced by analyze().

1370  {
1371  bsp_x = bs.x0();
1372  bsp_y = bs.y0();
1373  bsp_z = bs.x0();
1374  bsp_sigmax = bs.BeamWidthX();
1375  bsp_sigmay = bs.BeamWidthY();
1376  bsp_sigmaz = bs.sigmaZ();
1377 }
double BeamWidthX() const
beam width X
Definition: BeamSpot.h:86
double sigmaZ() const
sigma z
Definition: BeamSpot.h:80
double BeamWidthY() const
beam width Y
Definition: BeamSpot.h:88
double y0() const
y coordinate
Definition: BeamSpot.h:66
double x0() const
x coordinate
Definition: BeamSpot.h:64
void TrackingNtuple::fillDescriptions ( edm::ConfigurationDescriptions descriptions)
static

Definition at line 2367 of file TrackingNtuple.cc.

References edm::ConfigurationDescriptions::add(), edm::ParameterSetDescription::addUntracked(), HLT_25ns10e33_v2_cff::InputTag, and AlCaHLTBitMon_QueryRunRegistry::string.

2367  {
2368  //The following says we do not know what parameters are allowed so do no validation
2369  // Please change this to state exactly what you do use, even if it is no parameters
2371  desc.addUntracked<std::vector<edm::InputTag> >("seedTracks", std::vector<edm::InputTag>{
2372  edm::InputTag("seedTracksinitialStepSeeds"),
2373  edm::InputTag("seedTracksdetachedTripletStepSeeds"),
2374  edm::InputTag("seedTrackspixelPairStepSeeds"),
2375  edm::InputTag("seedTrackslowPtTripletStepSeeds"),
2376  edm::InputTag("seedTracksmixedTripletStepSeeds"),
2377  edm::InputTag("seedTrackspixelLessStepSeeds"),
2378  edm::InputTag("seedTrackstobTecStepSeeds"),
2379  edm::InputTag("seedTracksjetCoreRegionalStepSeeds"),
2380  edm::InputTag("seedTracksmuonSeededSeedsInOut"),
2381  edm::InputTag("seedTracksmuonSeededSeedsOutIn")
2382  });
2383  desc.addUntracked<edm::InputTag>("tracks", edm::InputTag("generalTracks"));
2384  desc.addUntracked<edm::InputTag>("trackingParticles", edm::InputTag("mix", "MergedTrackTruth"));
2385  desc.addUntracked<bool>("trackingParticlesRef", false);
2386  desc.addUntracked<edm::InputTag>("clusterTPMap", edm::InputTag("tpClusterProducer"));
2387  desc.addUntracked<edm::InputTag>("simHitTPMap", edm::InputTag("simHitTPAssocProducer"));
2388  desc.addUntracked<edm::InputTag>("trackAssociator", edm::InputTag("quickTrackAssociatorByHits"));
2389  desc.addUntracked<edm::InputTag>("pixelDigiSimLink", edm::InputTag("simSiPixelDigis"));
2390  desc.addUntracked<edm::InputTag>("stripDigiSimLink", edm::InputTag("simSiStripDigis"));
2391  desc.addUntracked<edm::InputTag>("beamSpot", edm::InputTag("offlineBeamSpot"));
2392  desc.addUntracked<edm::InputTag>("pixelRecHits", edm::InputTag("siPixelRecHits"));
2393  desc.addUntracked<edm::InputTag>("stripRphiRecHits", edm::InputTag("siStripMatchedRecHits", "rphiRecHit"));
2394  desc.addUntracked<edm::InputTag>("stripStereoRecHits", edm::InputTag("siStripMatchedRecHits", "stereoRecHit"));
2395  desc.addUntracked<edm::InputTag>("stripMatchedRecHits", edm::InputTag("siStripMatchedRecHits", "matchedRecHit"));
2396  desc.addUntracked<edm::InputTag>("vertices", edm::InputTag("offlinePrimaryVertices"));
2397  desc.addUntracked<edm::InputTag>("trackingVertices", edm::InputTag("mix", "MergedTrackTruth"));
2398  desc.addUntracked<edm::InputTag>("trackingParticleNlayers", edm::InputTag("trackingParticleNumberOfLayersProducer", "trackerLayers"));
2399  desc.addUntracked<edm::InputTag>("trackingParticleNpixellayers", edm::InputTag("trackingParticleNumberOfLayersProducer", "pixelLayers"));
2400  desc.addUntracked<edm::InputTag>("trackingParticleNstripstereolayers", edm::InputTag("trackingParticleNumberOfLayersProducer", "stripStereoLayers"));
2401  desc.addUntracked<std::string>("TTRHBuilder", "WithTrackAngle");
2402  desc.addUntracked<std::string>("parametersDefiner", "LhcParametersDefinerForTP");
2403  desc.addUntracked<bool>("includeSeeds", false);
2404  desc.addUntracked<bool>("includeAllHits", false);
2405  descriptions.add("trackingNtuple",desc);
2406 }
ParameterDescriptionBase * addUntracked(U const &iLabel, T const &value)
void add(std::string const &label, ParameterSetDescription const &psetDescription)
void TrackingNtuple::fillPixelHits ( const edm::Event iEvent,
const ClusterTPAssociation clusterToTPMap,
const TrackingParticleRefKeyToIndex tpKeyToIndex,
const SimHitTPAssociationProducer::SimHitTPAssociationList simHitsTPAssoc,
const edm::DetSetVector< PixelDigiSimLink > &  digiSimLink,
const TransientTrackingRecHitBuilder theTTRHBuilder,
const TrackerTopology tTopo,
const SimHitRefKeyToIndex simHitRefKeyToIndex,
std::set< edm::ProductID > &  hitProductIds 
)
private

Definition at line 1589 of file TrackingNtuple.cc.

References TransientTrackingRecHitBuilder::build(), TrackingNtuple::SimHitData::bunchCrossing, TrackingNtuple::SimHitData::chargeFraction, TrackingNtuple::SimHitData::event, edm::Event::getByToken(), hit::id, relval_steps::key, TrackerTopology::layer(), LogTrace, matchCluster(), TrackingNtuple::SimHitData::matchingSimHit, pix_bbxi, pix_chargeFraction, pix_det, pix_detId, pix_isBarrel, pix_lay, pix_radL, pix_seeIdx, pix_simHitIdx, pix_simType, pix_trkIdx, pix_x, pix_xx, pix_xy, pix_y, pix_yy, pix_yz, pix_z, pix_zx, pix_zz, Pixel, pixelRecHitToken_, DetId::rawId(), simhit_eloss, simhit_particle, simhit_process, simhit_x, simhit_y, simhit_z, DetId::subdetId(), and TrackingNtuple::SimHitData::type.

Referenced by analyze().

1598  {
1600  iEvent.getByToken(pixelRecHitToken_, pixelHits);
1601  for (auto it = pixelHits->begin(); it!=pixelHits->end(); it++ ) {
1602  const DetId hitId = it->detId();
1603  for (auto hit = it->begin(); hit!=it->end(); hit++ ) {
1604  TransientTrackingRecHit::RecHitPointer ttrh = theTTRHBuilder.build(&*hit);
1605 
1606  hitProductIds.insert(hit->cluster().id());
1607 
1608  const int key = hit->cluster().key();
1609  const int lay = tTopo.layer(hitId);
1610  SimHitData simHitData = matchCluster(hit->firstClusterRef(), hitId, key, ttrh,
1611  clusterToTPMap, tpKeyToIndex, simHitsTPAssoc, digiSimLink, simHitRefKeyToIndex, HitType::Pixel);
1612 
1613  pix_isBarrel .push_back( hitId.subdetId()==1 );
1614  pix_det .push_back( hitId.subdetId() );
1615  pix_lay .push_back( lay );
1616  pix_detId .push_back( hitId.rawId() );
1617  pix_trkIdx .emplace_back(); // filled in fillTracks
1618  pix_seeIdx .emplace_back(); // filled in fillSeeds
1619  pix_simHitIdx.push_back( simHitData.matchingSimHit );
1620  pix_simType.push_back( static_cast<int>(simHitData.type) );
1621  pix_x .push_back( ttrh->globalPosition().x() );
1622  pix_y .push_back( ttrh->globalPosition().y() );
1623  pix_z .push_back( ttrh->globalPosition().z() );
1624  pix_xx .push_back( ttrh->globalPositionError().cxx() );
1625  pix_xy .push_back( ttrh->globalPositionError().cyx() );
1626  pix_yy .push_back( ttrh->globalPositionError().cyy() );
1627  pix_yz .push_back( ttrh->globalPositionError().czy() );
1628  pix_zz .push_back( ttrh->globalPositionError().czz() );
1629  pix_zx .push_back( ttrh->globalPositionError().czx() );
1630  pix_chargeFraction.push_back( simHitData.chargeFraction );
1631  pix_radL .push_back( ttrh->surface()->mediumProperties().radLen() );
1632  pix_bbxi .push_back( ttrh->surface()->mediumProperties().xi() );
1633  LogTrace("TrackingNtuple") << "pixHit cluster=" << key
1634  << " subdId=" << hitId.subdetId()
1635  << " lay=" << lay
1636  << " rawId=" << hitId.rawId()
1637  << " pos =" << ttrh->globalPosition()
1638  << " nMatchingSimHit=" << simHitData.matchingSimHit.size();
1639  if(!simHitData.matchingSimHit.empty()) {
1640  const auto simHitIdx = simHitData.matchingSimHit[0];
1641  LogTrace("TrackingNtuple") << " firstMatchingSimHit=" << simHitIdx
1642  << " simHitPos=" << GlobalPoint(simhit_x[simHitIdx], simhit_y[simHitIdx], simhit_z[simHitIdx])
1643  << " energyLoss=" << simhit_eloss[simHitIdx]
1644  << " particleType=" << simhit_particle[simHitIdx]
1645  << " processType=" << simhit_process[simHitIdx]
1646  << " bunchCrossing=" << simHitData.bunchCrossing[0]
1647  << " event=" << simHitData.event[0];
1648  }
1649  }
1650  }
1651 }
std::vector< float > pix_y
std::vector< float > pix_zz
SimHitData matchCluster(const OmniClusterRef &cluster, DetId hitId, int clusterKey, const TransientTrackingRecHit::RecHitPointer &ttrh, const ClusterTPAssociation &clusterToTPMap, const TrackingParticleRefKeyToIndex &tpKeyToIndex, const SimHitTPAssociationProducer::SimHitTPAssociationList &simHitsTPAssoc, const edm::DetSetVector< SimLink > &digiSimLinks, const SimHitRefKeyToIndex &simHitRefKeyToIndex, HitType hitType)
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:457
std::vector< unsigned short > pix_simType
std::vector< float > pix_zx
Global3DPoint GlobalPoint
Definition: GlobalPoint.h:10
std::vector< short > simhit_process
std::vector< float > pix_xx
std::vector< float > pix_radL
std::vector< float > pix_bbxi
std::vector< std::vector< int > > pix_seeIdx
uint32_t rawId() const
get the raw id
Definition: DetId.h:43
std::vector< float > simhit_z
edm::EDGetTokenT< SiPixelRecHitCollection > pixelRecHitToken_
std::vector< unsigned short > pix_lay
std::vector< short > pix_isBarrel
std::vector< float > pix_z
virtual RecHitPointer build(const TrackingRecHit *p) const =0
build a tracking rechit from an existing rechit
std::vector< unsigned short > pix_det
std::vector< float > pix_yz
std::vector< std::vector< float > > pix_chargeFraction
std::vector< std::vector< int > > pix_trkIdx
int subdetId() const
get the contents of the subdetector field (not cast into any detector&#39;s numbering enum) ...
Definition: DetId.h:37
string key
FastSim: produces sample of signal events, overlayed with premixed minbias events.
#define LogTrace(id)
std::shared_ptr< TrackingRecHit const > RecHitPointer
unsigned int id
Definition: DetId.h:18
std::vector< std::vector< int > > pix_simHitIdx
std::vector< float > pix_x
unsigned int layer(const DetId &id) const
std::vector< int > simhit_particle
std::vector< float > simhit_y
std::vector< float > simhit_x
std::vector< float > pix_xy
std::vector< float > pix_yy
std::vector< unsigned int > pix_detId
std::vector< float > simhit_eloss
void TrackingNtuple::fillSeeds ( const edm::Event iEvent,
const TrackingParticleRefVector tpCollection,
const TrackingParticleRefKeyToIndex tpKeyToIndex,
const reco::BeamSpot bs,
const reco::TrackToTrackingParticleAssociator associatorByHits,
const TransientTrackingRecHitBuilder theTTRHBuilder,
const MagneticField theMF,
const std::vector< std::pair< int, int > > &  monoStereoClusterList,
const std::set< edm::ProductID > &  hitProductIds,
std::map< edm::ProductID, size_t > &  seedToCollIndex 
)
private

Hmm, the following could make sense instead of plain failing if propagation to beam line fails

Definition at line 1790 of file TrackingNtuple.cc.

References ecalcalib_dqm_sourceclient-live_cfg::algo, reco::TrackBase::algoByName(), reco::TrackToTrackingParticleAssociator::associateRecoToSim(), TransientTrackingRecHitBuilder::build(), RecoTauCleanerPlugins::charge, RZLine::chi2(), beam_dqm_sourceclient-live_cfg::chi2, OmniClusterRef::cluster_pixel(), OmniClusterRef::cluster_strip(), KineDebug3::count(), declareDynArray, HLT_25ns10e33_v2_cff::distance, edm::AssociationMap< Tag >::end(), eta, Exception, spr::find(), edm::AssociationMap< Tag >::find(), BaseTrackerRecHit::firstClusterRef(), edm::Event::getByToken(), glu_seeIdx, Glued, runTauDisplay::gp, i, edm::ProductID::id(), OmniClusterRef::id(), includeAllHits_, trackerHitRTTI::isMatched(), OmniClusterRef::key(), edm::Ref< C, T, F >::key(), diffTwoXMLs::label, HLT_25ns10e33_v2_cff::labels, edm::EDConsumerBase::labelsForToken(), LogTrace, edm::ProductLabels::module, SiStripMatchedRecHit2D::monoClusterRef(), phi, pix_seeIdx, Pixel, PixelSubdetector::PixelBarrel, PixelSubdetector::PixelEndcap, reco::BeamSpot::position(), EnergyCorrector::pt, edm::RefToBaseVector< T >::push_back(), see_algo, see_chi2, see_dxy, see_dxyErr, see_dz, see_dzErr, see_eta, see_etaErr, see_fitok, see_hitIdx, see_hitType, see_nGlued, see_nPixel, see_nStrip, see_nValid, see_offset, see_phi, see_phiErr, see_pt, see_ptErr, see_px, see_py, see_pz, see_q, see_shareFrac, see_simTrkIdx, see_trkIdx, fileCollector::seed, seedTokens_, SiStripMatchedRecHit2D::stereoClusterRef(), str_seeIdx, Strip, StripSubdetector::TIB, StripSubdetector::TOB, and trackFromSeedFitFailed().

Referenced by analyze().

1800  {
1801  TSCBLBuilderNoMaterial tscblBuilder;
1802  for(const auto& seedToken: seedTokens_) {
1803  edm::Handle<edm::View<reco::Track> > seedTracksHandle;
1804  iEvent.getByToken(seedToken, seedTracksHandle);
1805  const auto& seedTracks = *seedTracksHandle;
1806 
1807  if(seedTracks.empty())
1808  continue;
1809 
1810  // The associator interfaces really need to be fixed...
1811  edm::RefToBaseVector<reco::Track> seedTrackRefs;
1812  for(edm::View<reco::Track>::size_type i=0; i<seedTracks.size(); ++i) {
1813  seedTrackRefs.push_back(seedTracks.refAt(i));
1814  }
1815  reco::RecoToSimCollection recSimColl = associatorByHits.associateRecoToSim(seedTrackRefs, tpCollection);
1816 
1818  labelsForToken(seedToken, labels);
1819  TString label = labels.module;
1820  //format label to match algoName
1821  label.ReplaceAll("seedTracks", "");
1822  label.ReplaceAll("Seeds","");
1823  label.ReplaceAll("muonSeeded","muonSeededStep");
1824  int algo = reco::TrackBase::algoByName(label.Data());
1825 
1826  edm::ProductID id = seedTracks[0].seedRef().id();
1827  auto inserted = seedCollToOffset.emplace(id, see_fitok.size());
1828  if(!inserted.second)
1829  throw cms::Exception("Configuration") << "Trying to add seeds with ProductID " << id << " for a second time from collection " << labels.module << ", seed algo " << label << ". Typically this is caused by a configuration problem.";
1830  see_offset.push_back(see_fitok.size());
1831 
1832  LogTrace("TrackingNtuple") << "NEW SEED LABEL: " << label << " size: " << seedTracks.size() << " algo=" << algo
1833  << " ProductID " << id;
1834 
1835  for(const auto& seedTrackRef: seedTrackRefs) {
1836  const auto& seedTrack = *seedTrackRef;
1837  const auto& seedRef = seedTrack.seedRef();
1838  const auto& seed = *seedRef;
1839 
1840  if(seedRef.id() != id)
1841  throw cms::Exception("LogicError") << "All tracks in 'TracksFromSeeds' collection should point to seeds in the same collection. Now the element 0 had ProductID " << id << " while the element " << seedTrackRef.key() << " had " << seedTrackRef.id() << ". The source collection is " << labels.module << ".";
1842 
1843  std::vector<float> sharedFraction;
1844  std::vector<int> tpIdx;
1845  auto foundTPs = recSimColl.find(seedTrackRef);
1846  if (foundTPs != recSimColl.end()) {
1847  for(const auto tpQuality: foundTPs->val) {
1848  sharedFraction.push_back(tpQuality.second);
1849  tpIdx.push_back( tpKeyToIndex.at( tpQuality.first.key() ) );
1850  }
1851  }
1852 
1853 
1854  const bool seedFitOk = !trackFromSeedFitFailed(seedTrack);
1855  const int charge = seedTrack.charge();
1856  const float pt = seedFitOk ? seedTrack.pt() : 0;
1857  const float eta = seedFitOk ? seedTrack.eta() : 0;
1858  const float phi = seedFitOk ? seedTrack.phi() : 0;
1859  const int nHits = seedTrack.numberOfValidHits();
1860 
1861  const auto seedIndex = see_fitok.size();
1862 
1863  see_fitok .push_back(seedFitOk);
1864 
1865  see_px .push_back( seedFitOk ? seedTrack.px() : 0 );
1866  see_py .push_back( seedFitOk ? seedTrack.py() : 0 );
1867  see_pz .push_back( seedFitOk ? seedTrack.pz() : 0 );
1868  see_pt .push_back( pt );
1869  see_eta .push_back( eta );
1870  see_phi .push_back( phi );
1871  see_q .push_back( charge );
1872  see_nValid .push_back( nHits );
1873 
1874  see_dxy .push_back( seedFitOk ? seedTrack.dxy(bs.position()) : 0);
1875  see_dz .push_back( seedFitOk ? seedTrack.dz(bs.position()) : 0);
1876  see_ptErr .push_back( seedFitOk ? seedTrack.ptError() : 0);
1877  see_etaErr .push_back( seedFitOk ? seedTrack.etaError() : 0);
1878  see_phiErr .push_back( seedFitOk ? seedTrack.phiError() : 0);
1879  see_dxyErr .push_back( seedFitOk ? seedTrack.dxyError() : 0);
1880  see_dzErr .push_back( seedFitOk ? seedTrack.dzError() : 0);
1881  see_algo .push_back( algo );
1882 
1883  see_trkIdx .push_back(-1); // to be set correctly in fillTracks
1884  see_shareFrac.push_back( sharedFraction );
1885  see_simTrkIdx.push_back( tpIdx );
1886 
1888  /*
1889  TransientTrackingRecHit::RecHitPointer lastRecHit = theTTRHBuilder.build(&*(seed.recHits().second-1));
1890  TrajectoryStateOnSurface state = trajectoryStateTransform::transientState( itSeed->startingState(), lastRecHit->surface(), theMF);
1891  float pt = state.globalParameters().momentum().perp();
1892  float eta = state.globalParameters().momentum().eta();
1893  float phi = state.globalParameters().momentum().phi();
1894  see_px .push_back( state.globalParameters().momentum().x() );
1895  see_py .push_back( state.globalParameters().momentum().y() );
1896  see_pz .push_back( state.globalParameters().momentum().z() );
1897  */
1898 
1899  std::vector<int> hitIdx;
1900  std::vector<int> hitType;
1901 
1902  for (auto hit=seed.recHits().first; hit!=seed.recHits().second; ++hit) {
1903  TransientTrackingRecHit::RecHitPointer recHit = theTTRHBuilder.build(&*hit);
1904  int subid = recHit->geographicalId().subdetId();
1905  if (subid == (int) PixelSubdetector::PixelBarrel || subid == (int) PixelSubdetector::PixelEndcap) {
1906  const BaseTrackerRecHit* bhit = dynamic_cast<const BaseTrackerRecHit*>(&*recHit);
1907  const auto& clusterRef = bhit->firstClusterRef();
1908  const auto clusterKey = clusterRef.cluster_pixel().key();
1909  if(includeAllHits_) {
1910  checkProductID(hitProductIds, clusterRef.id(), "seed");
1911  pix_seeIdx[clusterKey].push_back(seedIndex);
1912  }
1913  hitIdx.push_back( clusterKey );
1914  hitType.push_back( static_cast<int>(HitType::Pixel) );
1915  } else {
1916  if (trackerHitRTTI::isMatched(*recHit)) {
1917  const SiStripMatchedRecHit2D * matchedHit = dynamic_cast<const SiStripMatchedRecHit2D *>(&*recHit);
1918  if(includeAllHits_) {
1919  checkProductID(hitProductIds, matchedHit->monoClusterRef().id(), "seed");
1920  checkProductID(hitProductIds, matchedHit->stereoClusterRef().id(), "seed");
1921  }
1922  int monoIdx = matchedHit->monoClusterRef().key();
1923  int stereoIdx = matchedHit->stereoClusterRef().key();
1924 
1925  std::vector<std::pair<int,int> >::const_iterator pos = find( monoStereoClusterList.begin(), monoStereoClusterList.end(), std::make_pair(monoIdx,stereoIdx) );
1926  const auto gluedIndex = std::distance(monoStereoClusterList.begin(), pos);
1927  if(includeAllHits_) glu_seeIdx[gluedIndex].push_back(seedIndex);
1928  hitIdx.push_back( gluedIndex );
1929  hitType.push_back( static_cast<int>(HitType::Glued) );
1930  } else {
1931  const BaseTrackerRecHit* bhit = dynamic_cast<const BaseTrackerRecHit*>(&*recHit);
1932  const auto& clusterRef = bhit->firstClusterRef();
1933  const auto clusterKey = clusterRef.cluster_strip().key();
1934  if(includeAllHits_) {
1935  checkProductID(hitProductIds, clusterRef.id(), "seed");
1936  str_seeIdx[clusterKey].push_back(seedIndex);
1937  }
1938  hitIdx.push_back( clusterKey );
1939  hitType.push_back( static_cast<int>(HitType::Strip) );
1940  }
1941  }
1942  }
1943  see_hitIdx .push_back( hitIdx );
1944  see_hitType .push_back( hitType );
1945  see_nPixel .push_back( std::count(hitType.begin(), hitType.end(), static_cast<int>(HitType::Pixel)) );
1946  see_nGlued .push_back( std::count(hitType.begin(), hitType.end(), static_cast<int>(HitType::Glued)) );
1947  see_nStrip .push_back( std::count(hitType.begin(), hitType.end(), static_cast<int>(HitType::Strip)) );
1948  //the part below is not strictly needed
1949  float chi2 = -1;
1950  if (nHits==2) {
1951  TransientTrackingRecHit::RecHitPointer recHit0 = theTTRHBuilder.build(&*(seed.recHits().first));
1952  TransientTrackingRecHit::RecHitPointer recHit1 = theTTRHBuilder.build(&*(seed.recHits().first+1));
1953  std::vector<GlobalPoint> gp(2);
1954  std::vector<GlobalError> ge(2);
1955  gp[0] = recHit0->globalPosition();
1956  ge[0] = recHit0->globalPositionError();
1957  gp[1] = recHit1->globalPosition();
1958  ge[1] = recHit1->globalPositionError();
1959  LogTrace("TrackingNtuple") << "seed " << seedTrackRef.key()
1960  << " pt=" << pt << " eta=" << eta << " phi=" << phi << " q=" << charge
1961  << " - PAIR - ids: " << recHit0->geographicalId().rawId() << " " << recHit1->geographicalId().rawId()
1962  << " hitpos: " << gp[0] << " " << gp[1]
1963  << " trans0: " << (recHit0->transientHits().size()>1 ? recHit0->transientHits()[0]->globalPosition() : GlobalPoint(0,0,0))
1964  << " " << (recHit0->transientHits().size()>1 ? recHit0->transientHits()[1]->globalPosition() : GlobalPoint(0,0,0))
1965  << " trans1: " << (recHit1->transientHits().size()>1 ? recHit1->transientHits()[0]->globalPosition() : GlobalPoint(0,0,0))
1966  << " " << (recHit1->transientHits().size()>1 ? recHit1->transientHits()[1]->globalPosition() : GlobalPoint(0,0,0))
1967  << " eta,phi: " << gp[0].eta() << "," << gp[0].phi();
1968  } else if (nHits==3) {
1969  TransientTrackingRecHit::RecHitPointer recHit0 = theTTRHBuilder.build(&*(seed.recHits().first));
1970  TransientTrackingRecHit::RecHitPointer recHit1 = theTTRHBuilder.build(&*(seed.recHits().first+1));
1971  TransientTrackingRecHit::RecHitPointer recHit2 = theTTRHBuilder.build(&*(seed.recHits().first+2));
1974  declareDynArray(bool,4, bl);
1975  gp[0] = recHit0->globalPosition();
1976  ge[0] = recHit0->globalPositionError();
1977  int subid0 = recHit0->geographicalId().subdetId();
1978  bl[0] = (subid0 == StripSubdetector::TIB || subid0 == StripSubdetector::TOB || subid0 == (int) PixelSubdetector::PixelBarrel);
1979  gp[1] = recHit1->globalPosition();
1980  ge[1] = recHit1->globalPositionError();
1981  int subid1 = recHit1->geographicalId().subdetId();
1982  bl[1] = (subid1 == StripSubdetector::TIB || subid1 == StripSubdetector::TOB || subid1 == (int) PixelSubdetector::PixelBarrel);
1983  gp[2] = recHit2->globalPosition();
1984  ge[2] = recHit2->globalPositionError();
1985  int subid2 = recHit2->geographicalId().subdetId();
1986  bl[2] = (subid2 == StripSubdetector::TIB || subid2 == StripSubdetector::TOB || subid2 == (int) PixelSubdetector::PixelBarrel);
1987  RZLine rzLine(gp,ge,bl);
1988  float seed_chi2 = rzLine.chi2();
1989  //float seed_pt = state.globalParameters().momentum().perp();
1990  float seed_pt = pt;
1991  LogTrace("TrackingNtuple") << "seed " << seedTrackRef.key()
1992  << " pt=" << pt << " eta=" << eta << " phi=" << phi << " q=" << charge
1993  << " - TRIPLET - ids: " << recHit0->geographicalId().rawId() << " " << recHit1->geographicalId().rawId() << " " << recHit2->geographicalId().rawId()
1994  << " hitpos: " << gp[0] << " " << gp[1] << " " << gp[2]
1995  << " trans0: " << (recHit0->transientHits().size()>1 ? recHit0->transientHits()[0]->globalPosition() : GlobalPoint(0,0,0))
1996  << " " << (recHit0->transientHits().size()>1 ? recHit0->transientHits()[1]->globalPosition() : GlobalPoint(0,0,0))
1997  << " trans1: " << (recHit1->transientHits().size()>1 ? recHit1->transientHits()[0]->globalPosition() : GlobalPoint(0,0,0))
1998  << " " << (recHit1->transientHits().size()>1 ? recHit1->transientHits()[1]->globalPosition() : GlobalPoint(0,0,0))
1999  << " trans2: " << (recHit2->transientHits().size()>1 ? recHit2->transientHits()[0]->globalPosition() : GlobalPoint(0,0,0))
2000  << " " << (recHit2->transientHits().size()>1 ? recHit2->transientHits()[1]->globalPosition() : GlobalPoint(0,0,0))
2001  << " local: " << recHit2->localPosition()
2002  //<< " tsos pos, mom: " << state.globalPosition()<<" "<<state.globalMomentum()
2003  << " eta,phi: " << gp[0].eta() << "," << gp[0].phi()
2004  << " pt,chi2: " << seed_pt << "," << seed_chi2;
2005  chi2 = seed_chi2;
2006  }
2007  see_chi2 .push_back( chi2 );
2008  }
2009  }
2010 }
unsigned int size_type
Definition: View.h:85
std::vector< short > see_fitok
std::vector< std::vector< int > > see_hitType
int i
Definition: DBlmapReader.cc:9
std::vector< unsigned int > see_nValid
bool trackFromSeedFitFailed(const reco::Track &track)
std::vector< float > see_phiErr
const_iterator end() const
last iterator over the map (read only)
std::vector< float > see_dzErr
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:457
std::vector< unsigned int > see_nStrip
OmniClusterRef const & stereoClusterRef() const
std::vector< float > see_px
std::vector< float > see_chi2
const_iterator find(const key_type &k) const
find element with specified reference key
Global3DPoint GlobalPoint
Definition: GlobalPoint.h:10
std::vector< unsigned int > see_algo
std::vector< std::vector< int > > str_seeIdx
std::vector< std::vector< int > > see_simTrkIdx
key_type key() const
Accessor for product key.
Definition: Ref.h:264
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Definition: FindCaloHit.cc:7
std::vector< std::vector< int > > pix_seeIdx
ClusterPixelRef cluster_pixel() const
std::vector< float > see_etaErr
virtual RecHitPointer build(const TrackingRecHit *p) const =0
build a tracking rechit from an existing rechit
ClusterStripRef cluster_strip() const
std::vector< int > see_q
std::vector< edm::EDGetTokenT< edm::View< reco::Track > > > seedTokens_
std::vector< float > see_dxyErr
bool isMatched(TrackingRecHit const &hit)
std::vector< float > see_pt
std::vector< std::vector< int > > glu_seeIdx
std::vector< float > see_dxy
std::vector< float > see_phi
OmniClusterRef const & monoClusterRef() const
char const * module
Definition: ProductLabels.h:5
std::vector< float > see_pz
#define LogTrace(id)
std::shared_ptr< TrackingRecHit const > RecHitPointer
Definition: RZLine.h:12
std::vector< unsigned int > see_nGlued
std::vector< float > see_py
reco::RecoToSimCollection associateRecoToSim(const edm::Handle< edm::View< reco::Track > > &tCH, const edm::Handle< TrackingParticleCollection > &tPCH) const
compare reco to sim the handle of reco::Track and TrackingParticle collections
std::vector< float > see_ptErr
virtual OmniClusterRef const & firstClusterRef() const =0
void labelsForToken(EDGetToken iToken, Labels &oLabels) const
std::vector< std::vector< float > > see_shareFrac
const bool includeAllHits_
edm::ProductID id() const
void push_back(const RefToBase< T > &)
static TrackAlgorithm algoByName(const std::string &name)
Definition: TrackBase.cc:137
const Point & position() const
position
Definition: BeamSpot.h:62
#define declareDynArray(T, n, x)
Definition: DynArray.h:59
std::vector< unsigned int > see_offset
ProductIndex id() const
Definition: ProductID.h:38
std::vector< int > see_trkIdx
unsigned int key() const
std::vector< std::vector< int > > see_hitIdx
std::vector< unsigned int > see_nPixel
std::vector< float > see_eta
std::vector< float > see_dz
void TrackingNtuple::fillSimHits ( const TrackerGeometry tracker,
const TrackingParticleRefKeyToIndex tpKeyToIndex,
const SimHitTPAssociationProducer::SimHitTPAssociationList simHitsTPAssoc,
const TrackerTopology tTopo,
SimHitRefKeyToIndex simHitRefKeyToIndex,
std::vector< TPHitIndex > &  tpHitList 
)
private

Definition at line 1493 of file TrackingNtuple.cc.

References funct::abs(), DetId::det(), Exception, TrackerGeometry::idToDetUnit(), TrackerTopology::layer(), LogTrace, TrackingParticle::pdgId(), DetId::rawId(), simhit_det, simhit_detId, simhit_eloss, simhit_hitIdx, simhit_hitType, simhit_lay, simhit_particle, simhit_process, simhit_simTrkIdx, simhit_tof, simhit_x, simhit_y, simhit_z, SimHitTPAssociationProducer::simHitTPAssociationListGreater(), DetId::subdetId(), and DetId::Tracker.

Referenced by analyze().

1498  {
1499 
1500  for(const auto& assoc: simHitsTPAssoc) {
1501  auto tpKey = assoc.first.key();
1502 
1503  // SimHitTPAssociationList can contain more TrackingParticles than
1504  // what are given to this EDAnalyzer, so we can filter those out here.
1505  auto found = tpKeyToIndex.find(tpKey);
1506  if(found == tpKeyToIndex.end())
1507  continue;
1508  const auto tpIndex = found->second;
1509 
1510  // skip non-tracker simhits (mostly muons)
1511  const auto& simhit = *(assoc.second);
1512  auto detId = DetId(simhit.detUnitId());
1513  if(detId.det() != DetId::Tracker) continue;
1514 
1515  // Skip electron SimHits for non-electron TrackingParticles to
1516  // filter out delta rays. The delta ray hits just confuse. If we
1517  // need them later, let's add them as a separate "collection" of
1518  // hits of a TP
1519  const TrackingParticle& tp = *(assoc.first);
1520  if(std::abs(simhit.particleType()) == 11 && std::abs(tp.pdgId()) != 11) continue;
1521 
1522  auto simHitKey = std::make_pair(assoc.second.key(), assoc.second.id());
1523 
1524  if(simHitRefKeyToIndex.find(simHitKey) != simHitRefKeyToIndex.end()) {
1525  for(const auto& assoc2: simHitsTPAssoc) {
1526  if(std::make_pair(assoc2.second.key(), assoc2.second.id()) == simHitKey) {
1527 
1528 #ifdef EDM_ML_DEBUG
1529  auto range1 = std::equal_range(simHitsTPAssoc.begin(), simHitsTPAssoc.end(),
1530  std::make_pair(assoc.first, TrackPSimHitRef()),
1532  auto range2 = std::equal_range(simHitsTPAssoc.begin(), simHitsTPAssoc.end(),
1533  std::make_pair(assoc2.first, TrackPSimHitRef()),
1535 
1536  LogTrace("TrackingNtuple") << "Earlier TP " << assoc2.first.key() << " SimTrack Ids";
1537  for(const auto& simTrack: assoc2.first->g4Tracks()) {
1538  edm::LogPrint("TrackingNtuple") << " SimTrack " << simTrack.trackId() << " BX:event " << simTrack.eventId().bunchCrossing() << ":" << simTrack.eventId().event();
1539  }
1540  for(auto iHit = range2.first; iHit != range2.second; ++iHit) {
1541  LogTrace("TrackingNtuple") << " SimHit " << iHit->second.key() << " " << iHit->second.id() << " tof " << iHit->second->tof() << " trackId " << iHit->second->trackId() << " BX:event " << iHit->second->eventId().bunchCrossing() << ":" << iHit->second->eventId().event();
1542  }
1543  LogTrace("TrackingNtuple") << "Current TP " << assoc.first.key() << " SimTrack Ids";
1544  for(const auto& simTrack: assoc.first->g4Tracks()) {
1545  edm::LogPrint("TrackingNtuple") << " SimTrack " << simTrack.trackId() << " BX:event " << simTrack.eventId().bunchCrossing() << ":" << simTrack.eventId().event();
1546  }
1547  for(auto iHit = range1.first; iHit != range1.second; ++iHit) {
1548  LogTrace("TrackingNtuple") << " SimHit " << iHit->second.key() << " " << iHit->second.id() << " tof " << iHit->second->tof() << " trackId " << iHit->second->trackId() << " BX:event " << iHit->second->eventId().bunchCrossing() << ":" << iHit->second->eventId().event();
1549  }
1550 #endif
1551 
1552  throw cms::Exception("LogicError") << "Got second time the SimHit " << simHitKey.first << " of " << simHitKey.second << ", first time with TrackingParticle " << assoc2.first.key() << ", now with " << tpKey;
1553  }
1554  }
1555  throw cms::Exception("LogicError") << "Got second time the SimHit " << simHitKey.first << " of " << simHitKey.second << ", now with TrackingParticle " << tpKey << ", but I didn't find the first occurrance!";
1556  }
1557 
1558  auto det = tracker.idToDetUnit(detId);
1559  if(!det)
1560  throw cms::Exception("LogicError") << "Did not find a det unit for DetId " << simhit.detUnitId() << " from tracker geometry";
1561 
1562  const auto pos = det->surface().toGlobal(simhit.localPosition());
1563  const float tof = simhit.timeOfFlight();
1564 
1565  const auto simHitIndex = simhit_detId.size();
1566  simHitRefKeyToIndex[simHitKey] = simHitIndex;
1567 
1568  simhit_det.push_back(detId.subdetId());
1569  simhit_lay.push_back(tTopo.layer(detId));
1570  simhit_detId.push_back(detId.rawId());
1571  simhit_x.push_back(pos.x());
1572  simhit_y.push_back(pos.y());
1573  simhit_z.push_back(pos.z());
1574  simhit_particle.push_back(simhit.particleType());
1575  simhit_process.push_back(simhit.processType());
1576  simhit_eloss.push_back(simhit.energyLoss());
1577  simhit_tof.push_back(tof);
1578  //simhit_simTrackId.push_back(simhit.trackId());
1579 
1580  simhit_simTrkIdx.push_back(tpIndex);
1581 
1582  simhit_hitIdx.emplace_back(); // filled in matchCluster
1583  simhit_hitType.emplace_back(); // filled in matchCluster
1584 
1585  tpHitList.emplace_back(tpKey, simHitIndex, tof, simhit.detUnitId());
1586  }
1587 }
const TrackerGeomDet * idToDetUnit(DetId) const
Return the pointer to the GeomDetUnit corresponding to a given DetId.
std::vector< std::vector< int > > simhit_hitIdx
static bool simHitTPAssociationListGreater(SimHitTPPair i, SimHitTPPair j)
int pdgId() const
PDG ID.
std::vector< short > simhit_process
std::vector< unsigned short > simhit_det
std::vector< int > simhit_simTrkIdx
std::vector< float > simhit_z
std::vector< std::vector< int > > simhit_hitType
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
std::vector< unsigned int > simhit_detId
#define LogTrace(id)
Definition: DetId.h:18
std::vector< unsigned short > simhit_lay
unsigned int layer(const DetId &id) const
std::vector< int > simhit_particle
std::vector< float > simhit_y
Monte Carlo truth information used for tracking validation.
std::vector< float > simhit_x
std::vector< float > simhit_tof
std::vector< float > simhit_eloss
void TrackingNtuple::fillStripMatchedHits ( const edm::Event iEvent,
const TransientTrackingRecHitBuilder theTTRHBuilder,
const TrackerTopology tTopo,
std::vector< std::pair< int, int > > &  monoStereoClusterList 
)
private

Definition at line 1748 of file TrackingNtuple.cc.

References TransientTrackingRecHitBuilder::build(), edm::Event::getByToken(), glu_bbxi, glu_det, glu_detId, glu_isBarrel, glu_lay, glu_monoIdx, glu_radL, glu_seeIdx, glu_stereoIdx, glu_x, glu_xx, glu_xy, glu_y, glu_yy, glu_yz, glu_z, glu_zx, glu_zz, TrackerTopology::layer(), LogTrace, DetId::rawId(), stripMatchedRecHitToken_, DetId::subdetId(), StripSubdetector::TIB, and StripSubdetector::TOB.

Referenced by analyze().

1752  {
1754  iEvent.getByToken(stripMatchedRecHitToken_, matchedHits);
1755  for (auto it = matchedHits->begin(); it!=matchedHits->end(); it++ ) {
1756  const DetId hitId = it->detId();
1757  for (auto hit = it->begin(); hit!=it->end(); hit++ ) {
1758  TransientTrackingRecHit::RecHitPointer ttrh = theTTRHBuilder.build(&*hit);
1759  const int lay = tTopo.layer(hitId);
1760  monoStereoClusterList.emplace_back(hit->monoHit().cluster().key(),hit->stereoHit().cluster().key());
1761  glu_isBarrel .push_back( (hitId.subdetId()==StripSubdetector::TIB || hitId.subdetId()==StripSubdetector::TOB) );
1762  glu_det .push_back( hitId.subdetId() );
1763  glu_lay .push_back( tTopo.layer(hitId) );
1764  glu_detId .push_back( hitId.rawId() );
1765  glu_monoIdx .push_back( hit->monoHit().cluster().key() );
1766  glu_stereoIdx.push_back( hit->stereoHit().cluster().key() );
1767  glu_seeIdx .emplace_back(); // filled in fillSeeds
1768  glu_x .push_back( ttrh->globalPosition().x() );
1769  glu_y .push_back( ttrh->globalPosition().y() );
1770  glu_z .push_back( ttrh->globalPosition().z() );
1771  glu_xx .push_back( ttrh->globalPositionError().cxx() );
1772  glu_xy .push_back( ttrh->globalPositionError().cyx() );
1773  glu_yy .push_back( ttrh->globalPositionError().cyy() );
1774  glu_yz .push_back( ttrh->globalPositionError().czy() );
1775  glu_zz .push_back( ttrh->globalPositionError().czz() );
1776  glu_zx .push_back( ttrh->globalPositionError().czx() );
1777  glu_radL .push_back( ttrh->surface()->mediumProperties().radLen() );
1778  glu_bbxi .push_back( ttrh->surface()->mediumProperties().xi() );
1779  LogTrace("TrackingNtuple") << "stripMatchedHit"
1780  << " cluster0=" << hit->stereoHit().cluster().key()
1781  << " cluster1=" << hit->monoHit().cluster().key()
1782  << " subdId=" << hitId.subdetId()
1783  << " lay=" << lay
1784  << " rawId=" << hitId.rawId()
1785  << " pos =" << ttrh->globalPosition();
1786  }
1787  }
1788 }
edm::EDGetTokenT< SiStripMatchedRecHit2DCollection > stripMatchedRecHitToken_
std::vector< float > glu_xy
std::vector< float > glu_radL
std::vector< int > glu_monoIdx
std::vector< short > glu_isBarrel
std::vector< unsigned int > glu_lay
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:457
std::vector< float > glu_x
std::vector< unsigned int > glu_det
std::vector< float > glu_z
uint32_t rawId() const
get the raw id
Definition: DetId.h:43
std::vector< float > glu_y
std::vector< float > glu_yz
virtual RecHitPointer build(const TrackingRecHit *p) const =0
build a tracking rechit from an existing rechit
std::vector< float > glu_yy
std::vector< std::vector< int > > glu_seeIdx
int subdetId() const
get the contents of the subdetector field (not cast into any detector&#39;s numbering enum) ...
Definition: DetId.h:37
#define LogTrace(id)
std::vector< float > glu_zz
std::vector< float > glu_zx
std::shared_ptr< TrackingRecHit const > RecHitPointer
Definition: DetId.h:18
std::vector< int > glu_stereoIdx
unsigned int layer(const DetId &id) const
std::vector< float > glu_bbxi
std::vector< float > glu_xx
std::vector< unsigned int > glu_detId
void TrackingNtuple::fillStripRphiStereoHits ( const edm::Event iEvent,
const ClusterTPAssociation clusterToTPMap,
const TrackingParticleRefKeyToIndex tpKeyToIndex,
const SimHitTPAssociationProducer::SimHitTPAssociationList simHitsTPAssoc,
const edm::DetSetVector< StripDigiSimLink > &  digiSimLink,
const TransientTrackingRecHitBuilder theTTRHBuilder,
const TrackerTopology tTopo,
const SimHitRefKeyToIndex simHitRefKeyToIndex,
std::set< edm::ProductID > &  hitProductIds 
)
private

Definition at line 1654 of file TrackingNtuple.cc.

References TransientTrackingRecHitBuilder::build(), TrackingNtuple::SimHitData::bunchCrossing, TrackingNtuple::SimHitData::chargeFraction, TrackingNtuple::SimHitData::event, lumiContext::fill, edm::Event::getByToken(), hit::id, relval_steps::key, TrackerTopology::layer(), LogTrace, matchCluster(), TrackingNtuple::SimHitData::matchingSimHit, mergeVDriftHistosByStation::name, DetId::rawId(), simhit_eloss, simhit_particle, simhit_process, simhit_x, simhit_y, simhit_z, str_bbxi, str_chargeFraction, str_det, str_detId, str_isBarrel, str_isStereo, str_lay, str_radL, str_seeIdx, str_simHitIdx, str_simType, str_trkIdx, str_x, str_xx, str_xy, str_y, str_yy, str_yz, str_z, str_zx, str_zz, Strip, stripRphiRecHitToken_, stripStereoRecHitToken_, DetId::subdetId(), StripSubdetector::TIB, StripSubdetector::TOB, and TrackingNtuple::SimHitData::type.

Referenced by analyze().

1663  {
1664  //index strip hit branches by cluster index
1666  iEvent.getByToken(stripRphiRecHitToken_, rphiHits);
1668  iEvent.getByToken(stripStereoRecHitToken_, stereoHits);
1669  int totalStripHits = rphiHits->dataSize()+stereoHits->dataSize();
1670  str_isBarrel .resize(totalStripHits);
1671  str_isStereo .resize(totalStripHits);
1672  str_det .resize(totalStripHits);
1673  str_lay .resize(totalStripHits);
1674  str_detId .resize(totalStripHits);
1675  str_trkIdx .resize(totalStripHits); // filled in fillTracks
1676  str_seeIdx .resize(totalStripHits); // filled in fillSeeds
1677  str_simHitIdx.resize(totalStripHits);
1678  str_simType .resize(totalStripHits);
1679  str_x .resize(totalStripHits);
1680  str_y .resize(totalStripHits);
1681  str_z .resize(totalStripHits);
1682  str_xx .resize(totalStripHits);
1683  str_xy .resize(totalStripHits);
1684  str_yy .resize(totalStripHits);
1685  str_yz .resize(totalStripHits);
1686  str_zz .resize(totalStripHits);
1687  str_zx .resize(totalStripHits);
1688  str_chargeFraction.resize(totalStripHits);
1689  str_radL .resize(totalStripHits);
1690  str_bbxi .resize(totalStripHits);
1691 
1692  auto fill = [&](const SiStripRecHit2DCollection& hits, const char *name, bool isStereo) {
1693  for(const auto& detset: hits) {
1694  const DetId hitId = detset.detId();
1695  for(const auto& hit: detset) {
1696  TransientTrackingRecHit::RecHitPointer ttrh = theTTRHBuilder.build(&hit);
1697 
1698  hitProductIds.insert(hit.cluster().id());
1699 
1700  const int key = hit.cluster().key();
1701  const int lay = tTopo.layer(hitId);
1702  SimHitData simHitData = matchCluster(hit.firstClusterRef(), hitId, key, ttrh,
1703  clusterToTPMap, tpKeyToIndex, simHitsTPAssoc, digiSimLink, simHitRefKeyToIndex, HitType::Strip);
1705  str_isStereo [key] = isStereo;
1706  str_det [key] = hitId.subdetId();
1707  str_lay [key] = lay;
1708  str_detId [key] = hitId.rawId();
1709  str_simHitIdx[key] = simHitData.matchingSimHit;
1710  str_simType [key] = static_cast<int>(simHitData.type);
1711  str_x [key] = ttrh->globalPosition().x();
1712  str_y [key] = ttrh->globalPosition().y();
1713  str_z [key] = ttrh->globalPosition().z();
1714  str_xx [key] = ttrh->globalPositionError().cxx();
1715  str_xy [key] = ttrh->globalPositionError().cyx();
1716  str_yy [key] = ttrh->globalPositionError().cyy();
1717  str_yz [key] = ttrh->globalPositionError().czy();
1718  str_zz [key] = ttrh->globalPositionError().czz();
1719  str_zx [key] = ttrh->globalPositionError().czx();
1720  str_chargeFraction[key] = simHitData.chargeFraction;
1721  str_radL [key] = ttrh->surface()->mediumProperties().radLen();
1722  str_bbxi [key] = ttrh->surface()->mediumProperties().xi();
1723  LogTrace("TrackingNtuple") << name << " cluster=" << key
1724  << " subdId=" << hitId.subdetId()
1725  << " lay=" << lay
1726  << " rawId=" << hitId.rawId()
1727  << " pos =" << ttrh->globalPosition()
1728  << " nMatchingSimHit=" << simHitData.matchingSimHit.size();
1729  if(!simHitData.matchingSimHit.empty()) {
1730  const auto simHitIdx = simHitData.matchingSimHit[0];
1731  LogTrace("TrackingNtuple") << " firstMatchingSimHit=" << simHitIdx
1732  << " simHitPos=" << GlobalPoint(simhit_x[simHitIdx], simhit_y[simHitIdx], simhit_z[simHitIdx])
1733  << " simHitPos=" << GlobalPoint(simhit_x[simHitIdx], simhit_y[simHitIdx], simhit_z[simHitIdx])
1734  << " energyLoss=" << simhit_eloss[simHitIdx]
1735  << " particleType=" << simhit_particle[simHitIdx]
1736  << " processType=" << simhit_process[simHitIdx]
1737  << " bunchCrossing=" << simHitData.bunchCrossing[0]
1738  << " event=" << simHitData.event[0];
1739  }
1740  }
1741  }
1742  };
1743 
1744  fill(*rphiHits, "stripRPhiHit", false);
1745  fill(*stereoHits, "stripStereoHit", true);
1746 }
std::vector< unsigned short > str_lay
edm::EDGetTokenT< SiStripRecHit2DCollection > stripRphiRecHitToken_
string fill
Definition: lumiContext.py:319
std::vector< std::vector< int > > str_trkIdx
std::vector< float > str_yy
SimHitData matchCluster(const OmniClusterRef &cluster, DetId hitId, int clusterKey, const TransientTrackingRecHit::RecHitPointer &ttrh, const ClusterTPAssociation &clusterToTPMap, const TrackingParticleRefKeyToIndex &tpKeyToIndex, const SimHitTPAssociationProducer::SimHitTPAssociationList &simHitsTPAssoc, const edm::DetSetVector< SimLink > &digiSimLinks, const SimHitRefKeyToIndex &simHitRefKeyToIndex, HitType hitType)
std::vector< float > str_x
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:457
edm::EDGetTokenT< SiStripRecHit2DCollection > stripStereoRecHitToken_
std::vector< float > str_yz
Global3DPoint GlobalPoint
Definition: GlobalPoint.h:10
std::vector< short > simhit_process
std::vector< std::vector< int > > str_seeIdx
std::vector< float > str_radL
std::vector< short > str_isStereo
std::vector< unsigned short > str_simType
uint32_t rawId() const
get the raw id
Definition: DetId.h:43
std::vector< float > simhit_z
virtual RecHitPointer build(const TrackingRecHit *p) const =0
build a tracking rechit from an existing rechit
std::vector< float > str_y
std::vector< float > str_zz
int subdetId() const
get the contents of the subdetector field (not cast into any detector&#39;s numbering enum) ...
Definition: DetId.h:37
string key
FastSim: produces sample of signal events, overlayed with premixed minbias events.
#define LogTrace(id)
std::shared_ptr< TrackingRecHit const > RecHitPointer
unsigned int id
Definition: DetId.h:18
std::vector< unsigned short > str_det
std::vector< float > str_z
std::vector< float > str_zx
std::vector< float > str_xy
std::vector< std::vector< float > > str_chargeFraction
unsigned int layer(const DetId &id) const
std::vector< short > str_isBarrel
std::vector< int > simhit_particle
std::vector< float > simhit_y
std::vector< std::vector< int > > str_simHitIdx
std::vector< float > simhit_x
std::vector< float > str_xx
std::vector< float > simhit_eloss
std::vector< float > str_bbxi
std::vector< unsigned int > str_detId
void TrackingNtuple::fillTrackingParticles ( const edm::Event iEvent,
const edm::EventSetup iSetup,
const edm::RefToBaseVector< reco::Track > &  tracks,
const TrackingParticleRefVector tpCollection,
const TrackingVertexRefKeyToIndex tvKeyToIndex,
const reco::TrackToTrackingParticleAssociator associatorByHits,
const std::vector< TPHitIndex > &  tpHitList 
)
private

Definition at line 2175 of file TrackingNtuple.cc.

References reco::TrackToTrackingParticleAssociator::associateSimToReco(), funct::cos(), edm::AssociationMap< Tag >::end(), Exception, edm::AssociationMap< Tag >::find(), edm::EventSetup::get(), edm::Event::getByToken(), LogTrace, M_PI, ParametersDefinerForTP::momentum(), parametersDefinerName_, PixelSubdetector::PixelBarrel, PixelSubdetector::PixelEndcap, edm::ESHandle< class >::product(), sim_bunchCrossing, sim_decayVtxIdx, sim_eta, sim_event, sim_n3DLay, sim_nLay, sim_nPixel, sim_nPixelLay, sim_nStrip, sim_nValid, sim_parentVtxIdx, sim_pca_cotTheta, sim_pca_dxy, sim_pca_dz, sim_pca_eta, sim_pca_lambda, sim_pca_phi, sim_pca_pt, sim_pdgId, sim_phi, sim_pt, sim_px, sim_py, sim_pz, sim_q, sim_shareFrac, sim_simHitIdx, sim_trkIdx, simhit_detId, simhit_hitType, funct::sin(), mathSSE::sqrt(), funct::tan(), StripSubdetector::TEC, StripSubdetector::TIB, StripSubdetector::TID, StripSubdetector::TOB, tpHitIndexListLess(), tpNLayersToken_, tpNPixelLayersToken_, tpNStripStereoLayersToken_, DetId::Tracker, HLT_25ns10e33_v2_cff::trackQuality, Unknown, findQualityFiles::v, and ParametersDefinerForTP::vertex().

Referenced by analyze().

2181  {
2182  edm::ESHandle<ParametersDefinerForTP> parametersDefinerH;
2183  iSetup.get<TrackAssociatorRecord>().get(parametersDefinerName_, parametersDefinerH);
2184  const ParametersDefinerForTP *parametersDefiner = parametersDefinerH.product();
2185 
2186  // Number of 3D layers for TPs
2188  iEvent.getByToken(tpNLayersToken_, tpNLayersH);
2189  const auto& nLayers_tPCeff = *tpNLayersH;
2190 
2191  iEvent.getByToken(tpNPixelLayersToken_, tpNLayersH);
2192  const auto& nPixelLayers_tPCeff = *tpNLayersH;
2193 
2194  iEvent.getByToken(tpNStripStereoLayersToken_, tpNLayersH);
2195  const auto& nStripMonoAndStereoLayers_tPCeff = *tpNLayersH;
2196 
2197  reco::SimToRecoCollection simRecColl = associatorByHits.associateSimToReco(tracks, tpCollection);
2198 
2199  for(const TrackingParticleRef& tp: tpCollection) {
2200  LogTrace("TrackingNtuple") << "tracking particle pt=" << tp->pt() << " eta=" << tp->eta() << " phi=" << tp->phi();
2201  bool isRecoMatched = false;
2202  std::vector<int> tkIdx;
2203  std::vector<float> sharedFraction;
2204  auto foundTracks = simRecColl.find(tp);
2205  if(foundTracks != simRecColl.end()) {
2206  isRecoMatched = true;
2207  for(const auto trackQuality: foundTracks->val) {
2208  sharedFraction.push_back(trackQuality.second);
2209  tkIdx.push_back(trackQuality.first.key());
2210  }
2211  }
2212  LogTrace("TrackingNtuple") << "matched to tracks = " << make_VectorPrinter(tkIdx) << " isRecoMatched=" << isRecoMatched;
2213  sim_event .push_back(tp->eventId().event());
2214  sim_bunchCrossing.push_back(tp->eventId().bunchCrossing());
2215  sim_pdgId .push_back(tp->pdgId());
2216  sim_px .push_back(tp->px());
2217  sim_py .push_back(tp->py());
2218  sim_pz .push_back(tp->pz());
2219  sim_pt .push_back(tp->pt());
2220  sim_eta .push_back(tp->eta());
2221  sim_phi .push_back(tp->phi());
2222  sim_q .push_back(tp->charge());
2223  sim_trkIdx .push_back(tkIdx);
2224  sim_shareFrac.push_back(sharedFraction);
2225  sim_parentVtxIdx.push_back( tvKeyToIndex.at(tp->parentVertex().key()) );
2226  std::vector<int> decayIdx;
2227  for(const auto& v: tp->decayVertices())
2228  decayIdx.push_back( tvKeyToIndex.at(v.key()) );
2229  sim_decayVtxIdx.push_back(decayIdx);
2230 
2231  //Calcualte the impact parameters w.r.t. PCA
2232  TrackingParticle::Vector momentum = parametersDefiner->momentum(iEvent,iSetup,tp);
2233  TrackingParticle::Point vertex = parametersDefiner->vertex(iEvent,iSetup,tp);
2234  float dxySim = (-vertex.x()*sin(momentum.phi())+vertex.y()*cos(momentum.phi()));
2235  float dzSim = vertex.z() - (vertex.x()*momentum.x()+vertex.y()*momentum.y())/sqrt(momentum.perp2())
2236  * momentum.z()/sqrt(momentum.perp2());
2237  const double lambdaSim = M_PI/2 - momentum.theta();
2238  sim_pca_pt .push_back(std::sqrt(momentum.perp2()));
2239  sim_pca_eta .push_back(momentum.Eta());
2240  sim_pca_lambda .push_back(lambdaSim);
2241  sim_pca_cotTheta .push_back(1/tan(M_PI*0.5-lambdaSim));
2242  sim_pca_phi .push_back(momentum.phi());
2243  sim_pca_dxy .push_back(dxySim);
2244  sim_pca_dz .push_back(dzSim);
2245 
2246  std::vector<int> hitIdx;
2247  int nPixel=0, nStrip=0;
2248  auto rangeHit = std::equal_range(tpHitList.begin(), tpHitList.end(), TPHitIndex(tp.key()), tpHitIndexListLess);
2249  for(auto ip = rangeHit.first; ip != rangeHit.second; ++ip) {
2250  auto type = HitType::Unknown;
2251  if(!simhit_hitType[ip->simHitIdx].empty())
2252  type = static_cast<HitType>(simhit_hitType[ip->simHitIdx][0]);
2253  LogTrace("TrackingNtuple") << "simhit=" << ip->simHitIdx << " type=" << static_cast<int>(type);
2254  hitIdx.push_back(ip->simHitIdx);
2255  const auto detid = DetId(simhit_detId[ip->simHitIdx]);
2256  if(detid.det() != DetId::Tracker) {
2257  throw cms::Exception("LogicError") << "Encountered SimHit for TP " << tp.key() << " with DetId " << detid.rawId() << " whose det() is not Tracker but " << detid.det();
2258  }
2259  const auto subdet = detid.subdetId();
2260  switch(subdet) {
2263  ++nPixel;
2264  break;
2265  case StripSubdetector::TIB:
2266  case StripSubdetector::TID:
2267  case StripSubdetector::TOB:
2268  case StripSubdetector::TEC:
2269  ++nStrip;
2270  break;
2271  default:
2272  throw cms::Exception("LogicError") << "Encountered SimHit for TP " << tp.key() << " with DetId " << detid.rawId() << " whose subdet is not recognized, is " << subdet;
2273  };
2274  }
2275  sim_nValid .push_back( hitIdx.size() );
2276  sim_nPixel .push_back( nPixel );
2277  sim_nStrip .push_back( nStrip );
2278 
2279  const auto nSimLayers = nLayers_tPCeff[tp];
2280  const auto nSimPixelLayers = nPixelLayers_tPCeff[tp];
2281  const auto nSimStripMonoAndStereoLayers = nStripMonoAndStereoLayers_tPCeff[tp];
2282  sim_nLay .push_back( nSimLayers );
2283  sim_nPixelLay.push_back( nSimPixelLayers );
2284  sim_n3DLay .push_back( nSimPixelLayers+nSimStripMonoAndStereoLayers );
2285 
2286  sim_simHitIdx.push_back(hitIdx);
2287  }
2288 }
std::vector< float > sim_pca_dz
std::vector< unsigned int > sim_nLay
type
Definition: HCALResponse.h:21
std::vector< float > sim_pca_cotTheta
std::vector< float > sim_pca_dxy
std::vector< int > sim_bunchCrossing
const_iterator end() const
last iterator over the map (read only)
std::vector< unsigned int > sim_n3DLay
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:457
std::vector< float > sim_phi
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
const_iterator find(const key_type &k) const
find element with specified reference key
std::vector< std::vector< float > > sim_shareFrac
static bool tpHitIndexListLess(const TPHitIndex &i, const TPHitIndex &j)
std::vector< float > sim_py
std::vector< float > sim_px
std::vector< std::vector< int > > sim_decayVtxIdx
std::vector< int > sim_q
math::XYZPointD Point
point in the space
std::vector< int > sim_event
edm::EDGetTokenT< edm::ValueMap< unsigned int > > tpNStripStereoLayersToken_
std::string parametersDefinerName_
std::vector< float > sim_pca_phi
T sqrt(T t)
Definition: SSEVec.h:18
std::vector< float > sim_eta
std::vector< int > sim_pdgId
Cos< T >::type cos(const T &t)
Definition: Cos.h:22
std::vector< std::vector< int > > simhit_hitType
Tan< T >::type tan(const T &t)
Definition: Tan.h:22
std::vector< unsigned int > sim_nValid
virtual TrackingParticle::Vector momentum(const edm::Event &iEvent, const edm::EventSetup &iSetup, const Charge ch, const Point &vtx, const LorentzVector &lv) const
std::vector< float > sim_pca_pt
std::vector< std::vector< int > > sim_trkIdx
std::vector< unsigned int > simhit_detId
std::vector< unsigned int > sim_nPixelLay
#define LogTrace(id)
std::vector< float > sim_pca_lambda
#define M_PI
std::vector< float > sim_pz
std::vector< std::vector< int > > sim_simHitIdx
Definition: DetId.h:18
std::vector< int > sim_parentVtxIdx
const T & get() const
Definition: EventSetup.h:56
T const * product() const
Definition: ESHandle.h:86
std::vector< unsigned int > sim_nPixel
edm::EDGetTokenT< edm::ValueMap< unsigned int > > tpNLayersToken_
std::vector< float > sim_pca_eta
edm::EDGetTokenT< edm::ValueMap< unsigned int > > tpNPixelLayersToken_
reco::SimToRecoCollection associateSimToReco(const edm::Handle< edm::View< reco::Track > > &tCH, const edm::Handle< TrackingParticleCollection > &tPCH) const
compare reco to sim the handle of reco::Track and TrackingParticle collections
math::XYZVectorD Vector
point in the space
std::vector< float > sim_pt
virtual TrackingParticle::Point vertex(const edm::Event &iEvent, const edm::EventSetup &iSetup, const Charge ch, const Point &vtx, const LorentzVector &lv) const
std::vector< unsigned int > sim_nStrip
void TrackingNtuple::fillTrackingVertices ( const TrackingVertexRefVector trackingVertices,
const TrackingParticleRefKeyToIndex tpKeyToIndex 
)
private

Definition at line 2322 of file TrackingNtuple.cc.

References EncodedEventId::bunchCrossing(), TrackingVertex::daughterTracks(), EncodedEventId::event(), TrackingVertex::eventId(), lumiContext::fill, TrackingVertex::g4Vertices(), bookConverter::max, TrackingVertex::position(), simpv_idx, simvtx_bunchCrossing, simvtx_daughterSimIdx, simvtx_event, simvtx_processType, simvtx_sourceSimIdx, simvtx_x, simvtx_y, simvtx_z, TrackingVertex::sourceTracks(), and findQualityFiles::v.

Referenced by analyze().

2324  {
2325  int current_event = -1;
2326  for(const auto& ref: trackingVertices) {
2327  const TrackingVertex v = *ref;
2328  if(v.eventId().event() != current_event) {
2329  // next PV
2330  current_event = v.eventId().event();
2331  simpv_idx.push_back(simvtx_x.size());
2332  }
2333 
2334  unsigned int processType = std::numeric_limits<unsigned int>::max();
2335  if(!v.g4Vertices().empty()) {
2336  processType = v.g4Vertices()[0].processType();
2337  }
2338 
2339  simvtx_event.push_back(v.eventId().event());
2340  simvtx_bunchCrossing.push_back(v.eventId().bunchCrossing());
2341  simvtx_processType.push_back(processType);
2342 
2343  simvtx_x.push_back(v.position().x());
2344  simvtx_y.push_back(v.position().y());
2345  simvtx_z.push_back(v.position().z());
2346 
2347  auto fill = [&](const TrackingParticleRefVector& tps, std::vector<int>& idx) {
2348  for(const auto& tpRef: tps) {
2349  auto found = tpKeyToIndex.find(tpRef.key());
2350  if(found != tpKeyToIndex.end()) {
2351  idx.push_back(tpRef.key());
2352  }
2353  }
2354  };
2355 
2356  std::vector<int> sourceIdx;
2357  std::vector<int> daughterIdx;
2358  fill(v.sourceTracks(), sourceIdx);
2359  fill(v.daughterTracks(), daughterIdx);
2360 
2361  simvtx_sourceSimIdx.push_back(sourceIdx);
2362  simvtx_daughterSimIdx.push_back(daughterIdx);
2363  }
2364 }
std::vector< unsigned int > simvtx_processType
std::vector< float > simvtx_z
const TrackingParticleRefVector & sourceTracks() const
int event() const
get the contents of the subdetector field (should be protected?)
string fill
Definition: lumiContext.py:319
const std::vector< SimVertex > & g4Vertices() const
std::vector< int > simvtx_event
std::vector< int > simpv_idx
std::vector< std::vector< int > > simvtx_sourceSimIdx
int bunchCrossing() const
get the detector field from this detid
std::vector< float > simvtx_x
const EncodedEventId & eventId() const
const TrackingParticleRefVector & daughterTracks() const
std::vector< float > simvtx_y
std::vector< std::vector< int > > simvtx_daughterSimIdx
std::vector< int > simvtx_bunchCrossing
const LorentzVector & position() const
void TrackingNtuple::fillTracks ( const edm::RefToBaseVector< reco::Track > &  tracks,
const TrackingParticleRefVector tpCollection,
const TrackingParticleRefKeyToIndex tpKeyToIndex,
const reco::BeamSpot bs,
const reco::TrackToTrackingParticleAssociator associatorByHits,
const TransientTrackingRecHitBuilder theTTRHBuilder,
const TrackerTopology tTopo,
const std::set< edm::ProductID > &  hitProductIds,
const std::map< edm::ProductID, size_t > &  seedToCollIndex 
)
private

Definition at line 2012 of file TrackingNtuple.cc.

References reco::TrackBase::algoName(), reco::TrackToTrackingParticleAssociator::associateRecoToSim(), TransientTrackingRecHitBuilder::build(), RecoTauCleanerPlugins::charge, beam_dqm_sourceclient-live_cfg::chi2, DetId::det(), HLT_25ns10e33_v2_cff::distance, edm::AssociationMap< Tag >::end(), eta, Exception, edm::AssociationMap< Tag >::find(), BaseTrackerRecHit::firstClusterRef(), reco::TrackBase::highPurity, AnalysisDataFormats_SUSYBSMObjects::hp, i, includeAllHits_, includeSeeds_, inv_det, inv_detId, inv_isBarrel, inv_lay, inv_type, Invalid, fastTrackerRecHitType::isPixel(), OmniClusterRef::isPixel(), HLT_25ns10e33_v2_cff::labels, edm::EDConsumerBase::labelsForToken(), TrackerTopology::layer(), LogTrace, M_PI, reco::HitPattern::MISSING_INNER_HITS, reco::HitPattern::MISSING_OUTER_HITS, edm::ProductLabels::module, reco::HitPattern::numberOfLostHits(), reco::HitPattern::numberOfLostTrackerHits(), reco::HitPattern::numberOfValidHits(), reco::HitPattern::numberOfValidPixelHits(), reco::HitPattern::numberOfValidStripHits(), reco::HitPattern::numberOfValidStripLayersWithMonoAndStereo(), hltrates_dqm_sourceclient-live_cfg::offset, phi, pix_trkIdx, Pixel, PixelSubdetector::PixelBarrel, PixelSubdetector::PixelEndcap, reco::HitPattern::pixelLayersWithMeasurement(), reco::BeamSpot::position(), EnergyCorrector::pt, DetId::rawId(), see_trkIdx, edm::RefToBaseVector< T >::size(), str_trkIdx, Strip, reco::HitPattern::stripLayersWithMeasurement(), DetId::subdetId(), funct::tan(), reco::HitPattern::TRACK_HITS, DetId::Tracker, trackToken_, trk_algo, trk_algoMask, trk_cotTheta, trk_dxy, trk_dxyErr, trk_dz, trk_dzErr, trk_eta, trk_etaErr, trk_hitIdx, trk_hitType, trk_inner_pt, trk_inner_px, trk_inner_py, trk_inner_pz, trk_isHP, trk_lambda, trk_lambdaErr, trk_n3DLay, trk_nChi2, trk_nInnerLost, trk_nInvalid, trk_nOuterLost, trk_nPixel, trk_nPixelLay, trk_nStrip, trk_nStripLay, trk_nValid, trk_originalAlgo, trk_outer_pt, trk_outer_px, trk_outer_py, trk_outer_pz, trk_phi, trk_phiErr, trk_pt, trk_ptErr, trk_px, trk_py, trk_pz, trk_q, trk_refpoint_x, trk_refpoint_y, trk_refpoint_z, trk_seedIdx, trk_shareFrac, trk_simTrkIdx, trk_stopReason, and trk_vtxIdx.

Referenced by analyze().

2021  {
2022  reco::RecoToSimCollection recSimColl = associatorByHits.associateRecoToSim(tracks, tpCollection);
2024  labelsForToken(trackToken_, labels);
2025  LogTrace("TrackingNtuple") << "NEW TRACK LABEL: " << labels.module;
2026  for(size_t iTrack = 0; iTrack<tracks.size(); ++iTrack) {
2027  const auto& itTrack = tracks[iTrack];
2028  int nSimHits = 0;
2029  bool isSimMatched = false;
2030  std::vector<float> sharedFraction;
2031  std::vector<int> tpIdx;
2032  auto foundTPs = recSimColl.find(itTrack);
2033  if (foundTPs != recSimColl.end()) {
2034  if (!foundTPs->val.empty()) {
2035  nSimHits = foundTPs->val[0].first->numberOfTrackerHits();
2036  isSimMatched = true;
2037  }
2038  for(const auto tpQuality: foundTPs->val) {
2039  sharedFraction.push_back(tpQuality.second);
2040  tpIdx.push_back( tpKeyToIndex.at( tpQuality.first.key() ) );
2041  }
2042  }
2043  int charge = itTrack->charge();
2044  float pt = itTrack->pt();
2045  float eta = itTrack->eta();
2046  const double lambda = itTrack->lambda();
2047  float chi2 = itTrack->normalizedChi2();
2048  float phi = itTrack->phi();
2049  int nHits = itTrack->numberOfValidHits();
2050  const reco::HitPattern& hp = itTrack->hitPattern();
2051  trk_px .push_back(itTrack->px());
2052  trk_py .push_back(itTrack->py());
2053  trk_pz .push_back(itTrack->pz());
2054  trk_pt .push_back(pt);
2055  trk_inner_px.push_back(itTrack->innerMomentum().x());
2056  trk_inner_py.push_back(itTrack->innerMomentum().y());
2057  trk_inner_pz.push_back(itTrack->innerMomentum().z());
2058  trk_inner_pt.push_back(itTrack->innerMomentum().rho());
2059  trk_outer_px.push_back(itTrack->outerMomentum().x());
2060  trk_outer_py.push_back(itTrack->outerMomentum().y());
2061  trk_outer_pz.push_back(itTrack->outerMomentum().z());
2062  trk_outer_pt.push_back(itTrack->outerMomentum().rho());
2063  trk_eta .push_back(eta);
2064  trk_lambda .push_back(lambda);
2065  trk_cotTheta .push_back(1/tan(M_PI*0.5-lambda));
2066  trk_phi .push_back(phi);
2067  trk_dxy .push_back(itTrack->dxy(bs.position()));
2068  trk_dz .push_back(itTrack->dz(bs.position()));
2069  trk_ptErr .push_back(itTrack->ptError());
2070  trk_etaErr .push_back(itTrack->etaError());
2071  trk_lambdaErr.push_back(itTrack->lambdaError());
2072  trk_phiErr .push_back(itTrack->phiError());
2073  trk_dxyErr .push_back(itTrack->dxyError());
2074  trk_dzErr .push_back(itTrack->dzError());
2075  trk_refpoint_x.push_back(itTrack->vx());
2076  trk_refpoint_y.push_back(itTrack->vy());
2077  trk_refpoint_z.push_back(itTrack->vz());
2078  trk_nChi2 .push_back( itTrack->normalizedChi2());
2079  trk_shareFrac.push_back(sharedFraction);
2080  trk_q .push_back(charge);
2081  trk_nValid .push_back(hp.numberOfValidHits());
2083  trk_nPixel .push_back(hp.numberOfValidPixelHits());
2084  trk_nStrip .push_back(hp.numberOfValidStripHits());
2085  trk_nPixelLay.push_back(hp.pixelLayersWithMeasurement());
2086  trk_nStripLay.push_back(hp.stripLayersWithMeasurement());
2090  trk_algo .push_back(itTrack->algo());
2091  trk_originalAlgo.push_back(itTrack->originalAlgo());
2092  trk_algoMask .push_back(itTrack->algoMaskUL());
2093  trk_stopReason.push_back(itTrack->stopReason());
2094  trk_isHP .push_back(itTrack->quality(reco::TrackBase::highPurity));
2095  if(includeSeeds_) {
2096  auto offset = seedCollToOffset.find(itTrack->seedRef().id());
2097  if(offset == seedCollToOffset.end()) {
2098  throw cms::Exception("Configuration") << "Track algo '" << reco::TrackBase::algoName(itTrack->algo())
2099  << "' originalAlgo '" << reco::TrackBase::algoName(itTrack->originalAlgo())
2100  << "' refers to seed collection " << itTrack->seedRef().id()
2101  << ", but that seed collection is not given as an input. The following collections were given as an input " << make_ProductIDMapPrinter(seedCollToOffset);
2102  }
2103 
2104  const auto seedIndex = offset->second + itTrack->seedRef().key();
2105  trk_seedIdx .push_back(seedIndex);
2106  if(see_trkIdx[seedIndex] != -1) {
2107  throw cms::Exception("LogicError") << "Track index has already been set for seed " << seedIndex << " to " << see_trkIdx[seedIndex] << "; was trying to set it to " << iTrack;
2108  }
2109  see_trkIdx[seedIndex] = iTrack;
2110  }
2111  trk_vtxIdx .push_back(-1); // to be set correctly in fillVertices
2112  trk_simTrkIdx.push_back(tpIdx);
2113  LogTrace("TrackingNtuple") << "Track #" << itTrack.key() << " with q=" << charge
2114  << ", pT=" << pt << " GeV, eta: " << eta << ", phi: " << phi
2115  << ", chi2=" << chi2
2116  << ", Nhits=" << nHits
2117  << ", algo=" << itTrack->algoName(itTrack->algo()).c_str()
2118  << " hp=" << itTrack->quality(reco::TrackBase::highPurity)
2119  << " seed#=" << itTrack->seedRef().key()
2120  << " simMatch=" << isSimMatched
2121  << " nSimHits=" << nSimHits
2122  << " sharedFraction=" << (sharedFraction.empty()?-1:sharedFraction[0])
2123  << " tpIdx=" << (tpIdx.empty()?-1:tpIdx[0]);
2124  std::vector<int> hitIdx;
2125  std::vector<int> hitType;
2126 
2127  for(auto i=itTrack->recHitsBegin(); i!=itTrack->recHitsEnd(); i++) {
2128  TransientTrackingRecHit::RecHitPointer hit=theTTRHBuilder.build(&**i );
2129  DetId hitId = hit->geographicalId();
2130  LogTrace("TrackingNtuple") << "hit #" << std::distance(itTrack->recHitsBegin(), i) << " subdet=" << hitId.subdetId();
2131  if(hitId.det() != DetId::Tracker)
2132  continue;
2133 
2134  LogTrace("TrackingNtuple") << " " << subdetstring(hitId.subdetId()) << " " << tTopo.layer(hitId);
2135  bool isPixel = (hitId.subdetId() == (int) PixelSubdetector::PixelBarrel || hitId.subdetId() == (int) PixelSubdetector::PixelEndcap );
2136 
2137  if (hit->isValid()) {
2138  //ugly... but works
2139  const BaseTrackerRecHit* bhit = dynamic_cast<const BaseTrackerRecHit*>(&*hit);
2140  const auto& clusterRef = bhit->firstClusterRef();
2141  const auto clusterKey = clusterRef.isPixel() ? clusterRef.cluster_pixel().key() : clusterRef.cluster_strip().key();
2142 
2143  LogTrace("TrackingNtuple") << " id: " << hitId.rawId() << " - globalPos =" << hit->globalPosition()
2144  << " cluster=" << clusterKey
2145  << " eta,phi: " << hit->globalPosition().eta() << "," << hit->globalPosition().phi();
2146  if(includeAllHits_) {
2147  checkProductID(hitProductIds, clusterRef.id(), "track");
2148  if(isPixel) pix_trkIdx[clusterKey].push_back(iTrack);
2149  else str_trkIdx[clusterKey].push_back(iTrack);
2150  }
2151 
2152  hitIdx.push_back(clusterKey);
2153  hitType.push_back( static_cast<int>( isPixel ? HitType::Pixel : HitType::Strip ) );
2154  } else {
2155  LogTrace("TrackingNtuple") << " - invalid hit";
2156 
2157  hitIdx.push_back( inv_isBarrel.size() );
2158  hitType.push_back( static_cast<int>(HitType::Invalid) );
2159 
2160  inv_isBarrel.push_back( hitId.subdetId()==1 );
2161  inv_det .push_back( hitId.subdetId() );
2162  inv_lay .push_back( tTopo.layer(hitId) );
2163  inv_detId .push_back( hitId.rawId() );
2164  inv_type .push_back( hit->getType() );
2165 
2166  }
2167  }
2168 
2169  trk_hitIdx.push_back(hitIdx);
2170  trk_hitType.push_back(hitType);
2171  }
2172 }
int i
Definition: DBlmapReader.cc:9
std::vector< float > trk_phi
std::vector< unsigned int > trk_nOuterLost
std::vector< float > trk_inner_pz
std::vector< int > trk_vtxIdx
std::vector< std::vector< int > > str_trkIdx
std::vector< float > trk_outer_py
std::vector< float > trk_eta
const_iterator end() const
last iterator over the map (read only)
std::vector< unsigned short > inv_lay
std::vector< float > trk_cotTheta
std::vector< float > trk_px
std::vector< unsigned short > inv_type
std::vector< std::vector< int > > trk_simTrkIdx
int numberOfValidHits() const
Definition: HitPattern.h:823
std::vector< float > trk_dxyErr
std::vector< float > trk_pt
std::vector< float > trk_inner_py
const_iterator find(const key_type &k) const
find element with specified reference key
edm::EDGetTokenT< edm::View< reco::Track > > trackToken_
std::vector< float > trk_outer_px
std::vector< std::vector< int > > trk_hitType
int numberOfValidStripHits() const
Definition: HitPattern.h:853
std::vector< float > trk_inner_pt
std::vector< unsigned int > inv_detId
int pixelLayersWithMeasurement() const
Definition: HitPattern.cc:499
std::vector< float > trk_refpoint_x
std::vector< unsigned int > trk_stopReason
int numberOfLostTrackerHits(HitCategory category) const
Definition: HitPattern.h:907
std::vector< short > inv_isBarrel
uint32_t rawId() const
get the raw id
Definition: DetId.h:43
std::vector< float > trk_refpoint_y
std::vector< unsigned int > trk_nStrip
std::vector< unsigned int > trk_nPixel
std::vector< float > trk_pz
std::vector< float > trk_dzErr
std::vector< float > trk_lambdaErr
int numberOfValidStripLayersWithMonoAndStereo(uint16_t stripdet, uint16_t layer) const
Definition: HitPattern.cc:341
std::vector< float > trk_etaErr
std::vector< unsigned int > trk_algo
susybsm::HSCParticleRefProd hp
Definition: classes.h:27
virtual RecHitPointer build(const TrackingRecHit *p) const =0
build a tracking rechit from an existing rechit
std::vector< unsigned int > trk_originalAlgo
std::vector< unsigned int > trk_nInnerLost
std::vector< float > trk_refpoint_z
std::vector< int > trk_seedIdx
std::vector< std::vector< int > > pix_trkIdx
Tan< T >::type tan(const T &t)
Definition: Tan.h:22
std::vector< unsigned int > trk_n3DLay
std::vector< float > trk_outer_pt
const bool includeSeeds_
size_type size() const
std::vector< float > trk_dz
std::vector< float > trk_ptErr
std::vector< unsigned int > trk_nStripLay
int subdetId() const
get the contents of the subdetector field (not cast into any detector&#39;s numbering enum) ...
Definition: DetId.h:37
char const * module
Definition: ProductLabels.h:5
bool isPixel() const
std::vector< float > trk_phiErr
std::vector< float > trk_lambda
#define LogTrace(id)
std::shared_ptr< TrackingRecHit const > RecHitPointer
#define M_PI
std::vector< std::vector< float > > trk_shareFrac
std::vector< unsigned short > inv_det
Definition: DetId.h:18
std::vector< float > trk_py
std::vector< float > trk_nChi2
reco::RecoToSimCollection associateRecoToSim(const edm::Handle< edm::View< reco::Track > > &tCH, const edm::Handle< TrackingParticleCollection > &tPCH) const
compare reco to sim the handle of reco::Track and TrackingParticle collections
virtual OmniClusterRef const & firstClusterRef() const =0
std::string algoName() const
Definition: TrackBase.h:503
int stripLayersWithMeasurement() const
Definition: HitPattern.h:1035
std::vector< short > trk_isHP
int numberOfLostHits(HitCategory category) const
Definition: HitPattern.h:902
std::vector< std::vector< int > > trk_hitIdx
unsigned int layer(const DetId &id) const
void labelsForToken(EDGetToken iToken, Labels &oLabels) const
std::vector< int > trk_q
const bool includeAllHits_
std::vector< float > trk_outer_pz
bool isPixel(HitType hitType)
int numberOfValidPixelHits() const
Definition: HitPattern.h:838
std::vector< unsigned int > trk_nPixelLay
const Point & position() const
position
Definition: BeamSpot.h:62
std::vector< int > see_trkIdx
Detector det() const
get the detector field from this detid
Definition: DetId.h:35
std::vector< float > trk_dxy
std::vector< unsigned int > trk_nInvalid
std::vector< decltype(reco::TrackBase().algoMaskUL())> trk_algoMask
std::vector< unsigned int > trk_nValid
std::vector< float > trk_inner_px
void TrackingNtuple::fillVertices ( const reco::VertexCollection vertices,
const edm::RefToBaseVector< reco::Track > &  tracks 
)
private

Definition at line 2290 of file TrackingNtuple.cc.

References reco::Vertex::chi2(), Exception, edm::RefToBaseVector< T >::id(), reco::Vertex::isFake(), reco::Vertex::isValid(), reco::Vertex::ndof(), findQualityFiles::size, reco::Vertex::tracks_begin(), reco::Vertex::tracks_end(), trk_vtxIdx, vtx_chi2, vtx_fake, vtx_ndof, vtx_trkIdx, vtx_valid, vtx_x, vtx_xErr, vtx_y, vtx_yErr, vtx_z, vtx_zErr, reco::Vertex::x(), reco::Vertex::xError(), reco::Vertex::y(), reco::Vertex::yError(), reco::Vertex::z(), and reco::Vertex::zError().

Referenced by analyze().

2291  {
2292  for(size_t iVertex=0, size=vertices.size(); iVertex<size; ++iVertex) {
2293  const reco::Vertex& vertex = vertices[iVertex];
2294  vtx_x.push_back(vertex.x());
2295  vtx_y.push_back(vertex.y());
2296  vtx_z.push_back(vertex.z());
2297  vtx_xErr.push_back(vertex.xError());
2298  vtx_yErr.push_back(vertex.yError());
2299  vtx_zErr.push_back(vertex.zError());
2300  vtx_chi2.push_back(vertex.chi2());
2301  vtx_ndof.push_back(vertex.ndof());
2302  vtx_fake.push_back(vertex.isFake());
2303  vtx_valid.push_back(vertex.isValid());
2304 
2305  std::vector<int> trkIdx;
2306  for(auto iTrack = vertex.tracks_begin(); iTrack != vertex.tracks_end(); ++iTrack) {
2307  // Ignore link if vertex was fit from a track collection different from the input
2308  if(iTrack->id() != tracks.id())
2309  continue;
2310 
2311  trkIdx.push_back(iTrack->key());
2312 
2313  if(trk_vtxIdx[iTrack->key()] != -1) {
2314  throw cms::Exception("LogicError") << "Vertex index has already been set for track " << iTrack->key() << " to " << trk_vtxIdx[iTrack->key()] << "; was trying to set it to " << iVertex;
2315  }
2316  trk_vtxIdx[iTrack->key()] = iVertex;
2317  }
2318  vtx_trkIdx.push_back(trkIdx);
2319  }
2320 }
std::vector< short > vtx_fake
std::vector< int > trk_vtxIdx
trackRef_iterator tracks_end() const
last iterator over tracks
Definition: Vertex.cc:81
double zError() const
error on z
Definition: Vertex.h:123
double y() const
y coordinate
Definition: Vertex.h:113
bool isValid() const
Tells whether the vertex is valid.
Definition: Vertex.h:68
std::vector< float > vtx_y
std::vector< float > vtx_yErr
std::vector< float > vtx_ndof
double chi2() const
chi-squares
Definition: Vertex.h:98
double z() const
z coordinate
Definition: Vertex.h:115
std::vector< float > vtx_z
double ndof() const
Definition: Vertex.h:105
std::vector< float > vtx_xErr
double x() const
x coordinate
Definition: Vertex.h:111
double xError() const
error on x
Definition: Vertex.h:119
bool isFake() const
Definition: Vertex.h:72
std::vector< short > vtx_valid
std::vector< std::vector< int > > vtx_trkIdx
trackRef_iterator tracks_begin() const
first iterator over tracks
Definition: Vertex.cc:76
std::vector< float > vtx_x
tuple size
Write out results.
ProductID id() const
double yError() const
error on y
Definition: Vertex.h:121
std::vector< float > vtx_zErr
std::vector< float > vtx_chi2
template<typename SimLink >
TrackingNtuple::SimHitData TrackingNtuple::matchCluster ( const OmniClusterRef cluster,
DetId  hitId,
int  clusterKey,
const TransientTrackingRecHit::RecHitPointer ttrh,
const ClusterTPAssociation clusterToTPMap,
const TrackingParticleRefKeyToIndex tpKeyToIndex,
const SimHitTPAssociationProducer::SimHitTPAssociationList simHitsTPAssoc,
const edm::DetSetVector< SimLink > &  digiSimLinks,
const SimHitRefKeyToIndex simHitRefKeyToIndex,
HitType  hitType 
)
private

Definition at line 1392 of file TrackingNtuple.cc.

References funct::abs(), TrackingNtuple::SimHitData::bunchCrossing, TrackingNtuple::SimHitData::chargeFraction, ClusterTPAssociation::equal_range(), event(), TrackingNtuple::SimHitData::event, Exception, edm::Ref< C, T, F >::id(), ITPileup, edm::Ref< C, T, F >::key(), TrackingNtuple::SimHitData::matchingSimHit, min(), Noise, OOTPileup, DetId::rawId(), runTheMatrix::ret, Signal, simhit_hitIdx, simhit_hitType, SimHitTPAssociationProducer::simHitTPAssociationListGreater(), and TrackingNtuple::SimHitData::type.

Referenced by fillPixelHits(), and fillStripRphiStereoHits().

1401  {
1402  SimHitData ret;
1403 
1404  auto simTrackIdToChargeFraction = chargeFraction(GetCluster<SimLink>::call(cluster), hitId, digiSimLinks);
1405 
1406  ret.type = HitSimType::Noise;
1407  auto range = clusterToTPMap.equal_range( cluster );
1408  if( range.first != range.second ) {
1409  for( auto ip=range.first; ip != range.second; ++ip ) {
1410  const TrackingParticleRef& trackingParticle = ip->second;
1411 
1412  // Find out if the cluster is from signal/ITPU/OOTPU
1413  const auto event = trackingParticle->eventId().event();
1414  const auto bx = trackingParticle->eventId().bunchCrossing();
1416  if(bx == 0) {
1417  type = (event == 0 ? HitSimType::Signal : HitSimType::ITPileup);
1418  }
1419  ret.type = static_cast<HitSimType>(std::min(static_cast<int>(ret.type), static_cast<int>(type)));
1420 
1421  // Limit to only input TrackingParticles (usually signal+ITPU)
1422  auto tpIndex = tpKeyToIndex.find(trackingParticle.key());
1423  if( tpIndex == tpKeyToIndex.end())
1424  continue;
1425  if( trackingParticle->numberOfHits() == 0 ) continue;
1426 
1427  //now get the corresponding sim hit
1428  std::pair<TrackingParticleRef, TrackPSimHitRef> simHitTPpairWithDummyTP(trackingParticle,TrackPSimHitRef());
1429  //SimHit is dummy: for simHitTPAssociationListGreater sorting only the TP is needed
1430  auto range = std::equal_range(simHitsTPAssoc.begin(), simHitsTPAssoc.end(),
1432  int simHitKey = -1;
1433  bool foundElectron = false;
1434  edm::ProductID simHitID;
1435  for(auto ip = range.first; ip != range.second; ++ip) {
1436  TrackPSimHitRef TPhit = ip->second;
1437  DetId dId = DetId(TPhit->detUnitId());
1438  if (dId.rawId()==hitId.rawId()) {
1439  // skip electron SimHits for non-electron TPs also here
1440  if(std::abs(TPhit->particleType()) == 11 && std::abs(trackingParticle->pdgId()) != 11) {
1441  foundElectron = true;
1442  continue;
1443  }
1444 
1445  simHitKey = TPhit.key();
1446  simHitID = TPhit.id();
1447  break;
1448  }
1449  }
1450  if(simHitKey < 0) {
1451  // In case we didn't find a simhit because of filtered-out
1452  // electron SimHit, just ignore the missing SimHit.
1453  if(foundElectron)
1454  continue;
1455 
1456  auto ex = cms::Exception("LogicError") << "Did not find SimHit for reco hit DetId " << hitId.rawId()
1457  << " for TP " << trackingParticle.key() << " bx:event " << bx << ":" << event
1458  << ".\nFound SimHits from detectors ";
1459  for(auto ip = range.first; ip != range.second; ++ip) {
1460  TrackPSimHitRef TPhit = ip->second;
1461  DetId dId = DetId(TPhit->detUnitId());
1462  ex << dId.rawId() << " ";
1463  }
1464  if(trackingParticle->eventId().event() != 0) {
1465  ex << "\nSince this is a TrackingParticle from pileup, check that you're running the pileup mixing in playback mode.";
1466  }
1467  throw ex;
1468  }
1469  auto simHitIndex = simHitRefKeyToIndex.at(std::make_pair(simHitKey, simHitID));
1470  ret.matchingSimHit.push_back(simHitIndex);
1471 
1472  double chargeFraction = 0.;
1473  for(const SimTrack& simtrk: trackingParticle->g4Tracks()) {
1474  auto found = simTrackIdToChargeFraction.find(simtrk.trackId());
1475  if(found != simTrackIdToChargeFraction.end()) {
1476  chargeFraction += found->second;
1477  }
1478  }
1479  ret.chargeFraction.push_back(chargeFraction);
1480 
1481  // only for debug prints
1482  ret.bunchCrossing.push_back(bx);
1483  ret.event.push_back(event);
1484 
1485  simhit_hitIdx[simHitIndex].push_back(clusterKey);
1486  simhit_hitType[simHitIndex].push_back(static_cast<int>(hitType));
1487  }
1488  }
1489 
1490  return ret;
1491 }
type
Definition: HCALResponse.h:21
tuple ret
prodAgent to be discontinued
std::vector< std::vector< int > > simhit_hitIdx
static bool simHitTPAssociationListGreater(SimHitTPPair i, SimHitTPPair j)
key_type key() const
Accessor for product key.
Definition: Ref.h:264
ProductID id() const
Accessor for product ID.
Definition: Ref.h:258
uint32_t rawId() const
get the raw id
Definition: DetId.h:43
std::vector< std::vector< int > > simhit_hitType
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
range equal_range(const OmniClusterRef &key) const
T min(T a, T b)
Definition: MathUtil.h:58
How EventSelector::AcceptEvent() decides whether to accept an event for output otherwise it is excluding the probing of A single or multiple positive and the trigger will pass if any such matching triggers are PASS or EXCEPTION[A criterion thatmatches no triggers at all is detected and causes a throw.] A single negative with an expectation of appropriate bit checking in the decision and the trigger will pass if any such matching triggers are FAIL or EXCEPTION A wildcarded negative criterion that matches more than one trigger in the trigger but the state exists so we define the behavior If all triggers are the negative crieriion will lead to accepting the event(this again matches the behavior of"!*"before the partial wildcard feature was incorporated).The per-event"cost"of each negative criterion with multiple relevant triggers is about the same as!*was in the past
Definition: DetId.h:18
edm::Ref< edm::PSimHitContainer > TrackPSimHitRef
static bool TrackingNtuple::tpHitIndexListLess ( const TPHitIndex i,
const TPHitIndex j 
)
inlinestaticprivate

Definition at line 294 of file TrackingNtuple.cc.

References TrackingNtuple::TPHitIndex::tpKey.

Referenced by fillTrackingParticles().

294 { return (i.tpKey < j.tpKey); }
int i
Definition: DBlmapReader.cc:9
int j
Definition: DBlmapReader.cc:9
static bool TrackingNtuple::tpHitIndexListLessSort ( const TPHitIndex i,
const TPHitIndex j 
)
inlinestaticprivate

Definition at line 295 of file TrackingNtuple.cc.

References TrackingNtuple::TPHitIndex::detId, edm::isNotFinite(), TrackingNtuple::TPHitIndex::tof, and TrackingNtuple::TPHitIndex::tpKey.

Referenced by analyze().

295  {
296  if(i.tpKey == j.tpKey) {
297  if(edm::isNotFinite(i.tof) && edm::isNotFinite(j.tof)) {
298  return i.detId < j.detId;
299  }
300  return i.tof < j.tof; // works as intended if either one is NaN
301  }
302  return i.tpKey < j.tpKey;
303  }
int i
Definition: DBlmapReader.cc:9
bool isNotFinite(T x)
Definition: isFinite.h:10
int j
Definition: DBlmapReader.cc:9

Member Data Documentation

edm::EDGetTokenT<reco::BeamSpot> TrackingNtuple::beamSpotToken_
private

Definition at line 411 of file TrackingNtuple.cc.

Referenced by analyze().

float TrackingNtuple::bsp_sigmax
private

Definition at line 613 of file TrackingNtuple.cc.

Referenced by clearVariables(), and fillBeamSpot().

float TrackingNtuple::bsp_sigmay
private

Definition at line 614 of file TrackingNtuple.cc.

Referenced by clearVariables(), and fillBeamSpot().

float TrackingNtuple::bsp_sigmaz
private

Definition at line 615 of file TrackingNtuple.cc.

Referenced by clearVariables(), and fillBeamSpot().

float TrackingNtuple::bsp_x
private

Definition at line 610 of file TrackingNtuple.cc.

Referenced by clearVariables(), and fillBeamSpot().

float TrackingNtuple::bsp_y
private

Definition at line 611 of file TrackingNtuple.cc.

Referenced by clearVariables(), and fillBeamSpot().

float TrackingNtuple::bsp_z
private

Definition at line 612 of file TrackingNtuple.cc.

Referenced by clearVariables(), and fillBeamSpot().

std::string TrackingNtuple::builderName_
private

Definition at line 421 of file TrackingNtuple.cc.

Referenced by analyze().

edm::EDGetTokenT<ClusterTPAssociation> TrackingNtuple::clusterTPMapToken_
private

Definition at line 406 of file TrackingNtuple.cc.

Referenced by analyze().

edm::EventNumber_t TrackingNtuple::ev_event
private

Definition at line 430 of file TrackingNtuple.cc.

Referenced by analyze(), and clearVariables().

edm::LuminosityBlockNumber_t TrackingNtuple::ev_lumi
private

Definition at line 429 of file TrackingNtuple.cc.

Referenced by analyze(), and clearVariables().

edm::RunNumber_t TrackingNtuple::ev_run
private

Definition at line 428 of file TrackingNtuple.cc.

Referenced by analyze(), and clearVariables().

std::vector<float> TrackingNtuple::glu_bbxi
private

Definition at line 582 of file TrackingNtuple.cc.

Referenced by clearVariables(), and fillStripMatchedHits().

std::vector<unsigned int> TrackingNtuple::glu_det
private

Definition at line 566 of file TrackingNtuple.cc.

Referenced by clearVariables(), and fillStripMatchedHits().

std::vector<unsigned int> TrackingNtuple::glu_detId
private

Definition at line 568 of file TrackingNtuple.cc.

Referenced by clearVariables(), and fillStripMatchedHits().

std::vector<short> TrackingNtuple::glu_isBarrel
private

Definition at line 565 of file TrackingNtuple.cc.

Referenced by clearVariables(), and fillStripMatchedHits().

std::vector<unsigned int> TrackingNtuple::glu_lay
private

Definition at line 567 of file TrackingNtuple.cc.

Referenced by clearVariables(), and fillStripMatchedHits().

std::vector<int> TrackingNtuple::glu_monoIdx
private

Definition at line 569 of file TrackingNtuple.cc.

Referenced by clearVariables(), and fillStripMatchedHits().

std::vector<float> TrackingNtuple::glu_radL
private

Definition at line 581 of file TrackingNtuple.cc.

Referenced by clearVariables(), and fillStripMatchedHits().

std::vector<std::vector<int> > TrackingNtuple::glu_seeIdx
private

Definition at line 571 of file TrackingNtuple.cc.

Referenced by clearVariables(), fillSeeds(), and fillStripMatchedHits().

std::vector<int> TrackingNtuple::glu_stereoIdx
private

Definition at line 570 of file TrackingNtuple.cc.

Referenced by clearVariables(), and fillStripMatchedHits().

std::vector<float> TrackingNtuple::glu_x
private

Definition at line 572 of file TrackingNtuple.cc.

Referenced by clearVariables(), and fillStripMatchedHits().

std::vector<float> TrackingNtuple::glu_xx
private

Definition at line 575 of file TrackingNtuple.cc.

Referenced by clearVariables(), and fillStripMatchedHits().

std::vector<float> TrackingNtuple::glu_xy
private

Definition at line 576 of file TrackingNtuple.cc.

Referenced by clearVariables(), and fillStripMatchedHits().

std::vector<float> TrackingNtuple::glu_y
private

Definition at line 573 of file TrackingNtuple.cc.

Referenced by clearVariables(), and fillStripMatchedHits().

std::vector<float> TrackingNtuple::glu_yy
private

Definition at line 577 of file TrackingNtuple.cc.

Referenced by clearVariables(), and fillStripMatchedHits().

std::vector<float> TrackingNtuple::glu_yz
private

Definition at line 578 of file TrackingNtuple.cc.

Referenced by clearVariables(), and fillStripMatchedHits().

std::vector<float> TrackingNtuple::glu_z
private

Definition at line 574 of file TrackingNtuple.cc.

Referenced by clearVariables(), and fillStripMatchedHits().

std::vector<float> TrackingNtuple::glu_zx
private

Definition at line 580 of file TrackingNtuple.cc.

Referenced by clearVariables(), and fillStripMatchedHits().

std::vector<float> TrackingNtuple::glu_zz
private

Definition at line 579 of file TrackingNtuple.cc.

Referenced by clearVariables(), and fillStripMatchedHits().

const bool TrackingNtuple::includeAllHits_
private

Definition at line 424 of file TrackingNtuple.cc.

Referenced by analyze(), fillSeeds(), and fillTracks().

const bool TrackingNtuple::includeSeeds_
private

Definition at line 423 of file TrackingNtuple.cc.

Referenced by analyze(), and fillTracks().

std::vector<unsigned short> TrackingNtuple::inv_det
private

Definition at line 587 of file TrackingNtuple.cc.

Referenced by clearVariables(), and fillTracks().

std::vector<unsigned int> TrackingNtuple::inv_detId
private

Definition at line 589 of file TrackingNtuple.cc.

Referenced by clearVariables(), and fillTracks().

std::vector<short> TrackingNtuple::inv_isBarrel
private

Definition at line 586 of file TrackingNtuple.cc.

Referenced by clearVariables(), and fillTracks().

std::vector<unsigned short> TrackingNtuple::inv_lay
private

Definition at line 588 of file TrackingNtuple.cc.

Referenced by clearVariables(), and fillTracks().

std::vector<unsigned short> TrackingNtuple::inv_type
private

Definition at line 590 of file TrackingNtuple.cc.

Referenced by clearVariables(), and fillTracks().

std::string TrackingNtuple::parametersDefinerName_
private

Definition at line 422 of file TrackingNtuple.cc.

Referenced by fillTrackingParticles().

std::vector<float> TrackingNtuple::pix_bbxi
private

Definition at line 537 of file TrackingNtuple.cc.

Referenced by clearVariables(), and fillPixelHits().

std::vector<std::vector<float> > TrackingNtuple::pix_chargeFraction
private

Definition at line 525 of file TrackingNtuple.cc.

Referenced by clearVariables(), and fillPixelHits().

std::vector<unsigned short> TrackingNtuple::pix_det
private

Definition at line 519 of file TrackingNtuple.cc.

Referenced by clearVariables(), and fillPixelHits().

std::vector<unsigned int> TrackingNtuple::pix_detId
private

Definition at line 521 of file TrackingNtuple.cc.

Referenced by clearVariables(), and fillPixelHits().

std::vector<short> TrackingNtuple::pix_isBarrel
private

Definition at line 518 of file TrackingNtuple.cc.

Referenced by clearVariables(), and fillPixelHits().

std::vector<unsigned short> TrackingNtuple::pix_lay
private

Definition at line 520 of file TrackingNtuple.cc.

Referenced by clearVariables(), and fillPixelHits().

std::vector<float> TrackingNtuple::pix_radL
private

Definition at line 536 of file TrackingNtuple.cc.

Referenced by clearVariables(), and fillPixelHits().

std::vector<std::vector<int> > TrackingNtuple::pix_seeIdx
private

Definition at line 523 of file TrackingNtuple.cc.

Referenced by clearVariables(), fillPixelHits(), and fillSeeds().

std::vector<std::vector<int> > TrackingNtuple::pix_simHitIdx
private

Definition at line 524 of file TrackingNtuple.cc.

Referenced by clearVariables(), and fillPixelHits().

std::vector<unsigned short> TrackingNtuple::pix_simType
private

Definition at line 526 of file TrackingNtuple.cc.

Referenced by clearVariables(), and fillPixelHits().

std::vector<std::vector<int> > TrackingNtuple::pix_trkIdx
private

Definition at line 522 of file TrackingNtuple.cc.

Referenced by clearVariables(), fillPixelHits(), and fillTracks().

std::vector<float> TrackingNtuple::pix_x
private

Definition at line 527 of file TrackingNtuple.cc.

Referenced by clearVariables(), and fillPixelHits().

std::vector<float> TrackingNtuple::pix_xx
private

Definition at line 530 of file TrackingNtuple.cc.

Referenced by clearVariables(), and fillPixelHits().

std::vector<float> TrackingNtuple::pix_xy
private

Definition at line 531 of file TrackingNtuple.cc.

Referenced by clearVariables(), and fillPixelHits().

std::vector<float> TrackingNtuple::pix_y
private

Definition at line 528 of file TrackingNtuple.cc.

Referenced by clearVariables(), and fillPixelHits().

std::vector<float> TrackingNtuple::pix_yy
private

Definition at line 532 of file TrackingNtuple.cc.

Referenced by clearVariables(), and fillPixelHits().

std::vector<float> TrackingNtuple::pix_yz
private

Definition at line 533 of file TrackingNtuple.cc.

Referenced by clearVariables(), and fillPixelHits().

std::vector<float> TrackingNtuple::pix_z
private

Definition at line 529 of file TrackingNtuple.cc.

Referenced by clearVariables(), and fillPixelHits().

std::vector<float> TrackingNtuple::pix_zx
private

Definition at line 535 of file TrackingNtuple.cc.

Referenced by clearVariables(), and fillPixelHits().

std::vector<float> TrackingNtuple::pix_zz
private

Definition at line 534 of file TrackingNtuple.cc.

Referenced by clearVariables(), and fillPixelHits().

edm::EDGetTokenT<SiPixelRecHitCollection> TrackingNtuple::pixelRecHitToken_
private

Definition at line 412 of file TrackingNtuple.cc.

Referenced by fillPixelHits().

edm::EDGetTokenT<edm::DetSetVector<PixelDigiSimLink> > TrackingNtuple::pixelSimLinkToken_
private

Definition at line 409 of file TrackingNtuple.cc.

Referenced by analyze().

std::vector<unsigned int> TrackingNtuple::see_algo
private

Definition at line 639 of file TrackingNtuple.cc.

Referenced by clearVariables(), and fillSeeds().

std::vector<float> TrackingNtuple::see_chi2
private

Definition at line 633 of file TrackingNtuple.cc.

Referenced by clearVariables(), and fillSeeds().

std::vector<float> TrackingNtuple::see_dxy
private

Definition at line 626 of file TrackingNtuple.cc.

Referenced by clearVariables(), and fillSeeds().

std::vector<float> TrackingNtuple::see_dxyErr
private

Definition at line 631 of file TrackingNtuple.cc.

Referenced by clearVariables(), and fillSeeds().

std::vector<float> TrackingNtuple::see_dz
private

Definition at line 627 of file TrackingNtuple.cc.

Referenced by clearVariables(), and fillSeeds().

std::vector<float> TrackingNtuple::see_dzErr
private

Definition at line 632 of file TrackingNtuple.cc.

Referenced by clearVariables(), and fillSeeds().

std::vector<float> TrackingNtuple::see_eta
private

Definition at line 624 of file TrackingNtuple.cc.

Referenced by clearVariables(), and fillSeeds().

std::vector<float> TrackingNtuple::see_etaErr
private

Definition at line 629 of file TrackingNtuple.cc.

Referenced by clearVariables(), and fillSeeds().

std::vector<short> TrackingNtuple::see_fitok
private

Definition at line 619 of file TrackingNtuple.cc.

Referenced by clearVariables(), and fillSeeds().

std::vector<std::vector<int> > TrackingNtuple::see_hitIdx
private

Definition at line 643 of file TrackingNtuple.cc.

Referenced by clearVariables(), and fillSeeds().

std::vector<std::vector<int> > TrackingNtuple::see_hitType
private

Definition at line 644 of file TrackingNtuple.cc.

Referenced by clearVariables(), and fillSeeds().

std::vector<unsigned int> TrackingNtuple::see_nGlued
private

Definition at line 637 of file TrackingNtuple.cc.

Referenced by clearVariables(), and fillSeeds().

std::vector<unsigned int> TrackingNtuple::see_nPixel
private

Definition at line 636 of file TrackingNtuple.cc.

Referenced by clearVariables(), and fillSeeds().

std::vector<unsigned int> TrackingNtuple::see_nStrip
private

Definition at line 638 of file TrackingNtuple.cc.

Referenced by clearVariables(), and fillSeeds().

std::vector<unsigned int> TrackingNtuple::see_nValid
private

Definition at line 635 of file TrackingNtuple.cc.

Referenced by clearVariables(), and fillSeeds().

std::vector<unsigned int> TrackingNtuple::see_offset
private

Definition at line 646 of file TrackingNtuple.cc.

Referenced by clearVariables(), and fillSeeds().

std::vector<float> TrackingNtuple::see_phi
private

Definition at line 625 of file TrackingNtuple.cc.

Referenced by clearVariables(), and fillSeeds().

std::vector<float> TrackingNtuple::see_phiErr
private

Definition at line 630 of file TrackingNtuple.cc.

Referenced by clearVariables(), and fillSeeds().

std::vector<float> TrackingNtuple::see_pt
private

Definition at line 623 of file TrackingNtuple.cc.

Referenced by clearVariables(), and fillSeeds().

std::vector<float> TrackingNtuple::see_ptErr
private

Definition at line 628 of file TrackingNtuple.cc.

Referenced by clearVariables(), and fillSeeds().

std::vector<float> TrackingNtuple::see_px
private

Definition at line 620 of file TrackingNtuple.cc.

Referenced by clearVariables(), and fillSeeds().

std::vector<float> TrackingNtuple::see_py
private

Definition at line 621 of file TrackingNtuple.cc.

Referenced by clearVariables(), and fillSeeds().

std::vector<float> TrackingNtuple::see_pz
private

Definition at line 622 of file TrackingNtuple.cc.

Referenced by clearVariables(), and fillSeeds().

std::vector<int> TrackingNtuple::see_q
private

Definition at line 634 of file TrackingNtuple.cc.

Referenced by clearVariables(), and fillSeeds().

std::vector<std::vector<float> > TrackingNtuple::see_shareFrac
private

Definition at line 641 of file TrackingNtuple.cc.

Referenced by clearVariables(), and fillSeeds().

std::vector<std::vector<int> > TrackingNtuple::see_simTrkIdx
private

Definition at line 642 of file TrackingNtuple.cc.

Referenced by clearVariables(), and fillSeeds().

std::vector<int> TrackingNtuple::see_trkIdx
private

Definition at line 640 of file TrackingNtuple.cc.

Referenced by clearVariables(), fillSeeds(), and fillTracks().

std::vector<edm::EDGetTokenT<edm::View<reco::Track> > > TrackingNtuple::seedTokens_
private

Definition at line 402 of file TrackingNtuple.cc.

Referenced by fillSeeds().

std::vector<int> TrackingNtuple::sim_bunchCrossing
private

Definition at line 488 of file TrackingNtuple.cc.

Referenced by clearVariables(), and fillTrackingParticles().

std::vector<std::vector<int> > TrackingNtuple::sim_decayVtxIdx
private

Definition at line 513 of file TrackingNtuple.cc.

Referenced by clearVariables(), and fillTrackingParticles().

std::vector<float> TrackingNtuple::sim_eta
private

Definition at line 494 of file TrackingNtuple.cc.

Referenced by clearVariables(), and fillTrackingParticles().

std::vector<int> TrackingNtuple::sim_event
private

Definition at line 487 of file TrackingNtuple.cc.

Referenced by clearVariables(), and fillTrackingParticles().

std::vector<unsigned int> TrackingNtuple::sim_n3DLay
private

Definition at line 509 of file TrackingNtuple.cc.

Referenced by clearVariables(), and fillTrackingParticles().

std::vector<unsigned int> TrackingNtuple::sim_nLay
private

Definition at line 507 of file TrackingNtuple.cc.

Referenced by clearVariables(), and fillTrackingParticles().

std::vector<unsigned int> TrackingNtuple::sim_nPixel
private

Definition at line 505 of file TrackingNtuple.cc.

Referenced by clearVariables(), and fillTrackingParticles().

std::vector<unsigned int> TrackingNtuple::sim_nPixelLay
private

Definition at line 508 of file TrackingNtuple.cc.

Referenced by clearVariables(), and fillTrackingParticles().

std::vector<unsigned int> TrackingNtuple::sim_nStrip
private

Definition at line 506 of file TrackingNtuple.cc.

Referenced by clearVariables(), and fillTrackingParticles().

std::vector<unsigned int> TrackingNtuple::sim_nValid
private

Definition at line 504 of file TrackingNtuple.cc.

Referenced by clearVariables(), and fillTrackingParticles().

std::vector<int> TrackingNtuple::sim_parentVtxIdx
private

Definition at line 512 of file TrackingNtuple.cc.

Referenced by clearVariables(), and fillTrackingParticles().

std::vector<float> TrackingNtuple::sim_pca_cotTheta
private

Definition at line 499 of file TrackingNtuple.cc.

Referenced by clearVariables(), and fillTrackingParticles().

std::vector<float> TrackingNtuple::sim_pca_dxy
private

Definition at line 501 of file TrackingNtuple.cc.

Referenced by clearVariables(), and fillTrackingParticles().

std::vector<float> TrackingNtuple::sim_pca_dz
private

Definition at line 502 of file TrackingNtuple.cc.

Referenced by clearVariables(), and fillTrackingParticles().

std::vector<float> TrackingNtuple::sim_pca_eta
private

Definition at line 497 of file TrackingNtuple.cc.

Referenced by clearVariables(), and fillTrackingParticles().

std::vector<float> TrackingNtuple::sim_pca_lambda
private

Definition at line 498 of file TrackingNtuple.cc.

Referenced by clearVariables(), and fillTrackingParticles().

std::vector<float> TrackingNtuple::sim_pca_phi
private

Definition at line 500 of file TrackingNtuple.cc.

Referenced by clearVariables(), and fillTrackingParticles().

std::vector<float> TrackingNtuple::sim_pca_pt
private

Definition at line 496 of file TrackingNtuple.cc.

Referenced by clearVariables(), and fillTrackingParticles().

std::vector<int> TrackingNtuple::sim_pdgId
private

Definition at line 489 of file TrackingNtuple.cc.

Referenced by clearVariables(), and fillTrackingParticles().

std::vector<float> TrackingNtuple::sim_phi
private

Definition at line 495 of file TrackingNtuple.cc.

Referenced by clearVariables(), and fillTrackingParticles().

std::vector<float> TrackingNtuple::sim_pt
private

Definition at line 493 of file TrackingNtuple.cc.

Referenced by clearVariables(), and fillTrackingParticles().

std::vector<float> TrackingNtuple::sim_px
private

Definition at line 490 of file TrackingNtuple.cc.

Referenced by clearVariables(), and fillTrackingParticles().

std::vector<float> TrackingNtuple::sim_py
private

Definition at line 491 of file TrackingNtuple.cc.

Referenced by clearVariables(), and fillTrackingParticles().

std::vector<float> TrackingNtuple::sim_pz
private

Definition at line 492 of file TrackingNtuple.cc.

Referenced by clearVariables(), and fillTrackingParticles().

std::vector<int> TrackingNtuple::sim_q
private

Definition at line 503 of file TrackingNtuple.cc.

Referenced by clearVariables(), and fillTrackingParticles().

std::vector<std::vector<float> > TrackingNtuple::sim_shareFrac
private

Definition at line 511 of file TrackingNtuple.cc.

Referenced by clearVariables(), and fillTrackingParticles().

std::vector<std::vector<int> > TrackingNtuple::sim_simHitIdx
private

Definition at line 514 of file TrackingNtuple.cc.

Referenced by clearVariables(), and fillTrackingParticles().

std::vector<std::vector<int> > TrackingNtuple::sim_trkIdx
private

Definition at line 510 of file TrackingNtuple.cc.

Referenced by clearVariables(), and fillTrackingParticles().

std::vector<unsigned short> TrackingNtuple::simhit_det
private

Definition at line 594 of file TrackingNtuple.cc.

Referenced by clearVariables(), and fillSimHits().

std::vector<unsigned int> TrackingNtuple::simhit_detId
private

Definition at line 596 of file TrackingNtuple.cc.

Referenced by clearVariables(), fillSimHits(), and fillTrackingParticles().

std::vector<float> TrackingNtuple::simhit_eloss
private
std::vector<std::vector<int> > TrackingNtuple::simhit_hitIdx
private

Definition at line 606 of file TrackingNtuple.cc.

Referenced by clearVariables(), fillSimHits(), and matchCluster().

std::vector<std::vector<int> > TrackingNtuple::simhit_hitType
private
std::vector<unsigned short> TrackingNtuple::simhit_lay
private

Definition at line 595 of file TrackingNtuple.cc.

Referenced by clearVariables(), and fillSimHits().

std::vector<int> TrackingNtuple::simhit_particle
private
std::vector<short> TrackingNtuple::simhit_process
private
std::vector<int> TrackingNtuple::simhit_simTrkIdx
private

Definition at line 605 of file TrackingNtuple.cc.

Referenced by clearVariables(), and fillSimHits().

std::vector<float> TrackingNtuple::simhit_tof
private

Definition at line 603 of file TrackingNtuple.cc.

Referenced by clearVariables(), and fillSimHits().

std::vector<float> TrackingNtuple::simhit_x
private
std::vector<float> TrackingNtuple::simhit_y
private
std::vector<float> TrackingNtuple::simhit_z
private
edm::EDGetTokenT<SimHitTPAssociationProducer::SimHitTPAssociationList> TrackingNtuple::simHitTPMapToken_
private

Definition at line 407 of file TrackingNtuple.cc.

Referenced by analyze().

std::vector<int> TrackingNtuple::simpv_idx
private

Definition at line 675 of file TrackingNtuple.cc.

Referenced by clearVariables(), and fillTrackingVertices().

std::vector<int> TrackingNtuple::simvtx_bunchCrossing
private

Definition at line 668 of file TrackingNtuple.cc.

Referenced by clearVariables(), and fillTrackingVertices().

std::vector<std::vector<int> > TrackingNtuple::simvtx_daughterSimIdx
private

Definition at line 674 of file TrackingNtuple.cc.

Referenced by clearVariables(), and fillTrackingVertices().

std::vector<int> TrackingNtuple::simvtx_event
private

Definition at line 667 of file TrackingNtuple.cc.

Referenced by clearVariables(), and fillTrackingVertices().

std::vector<unsigned int> TrackingNtuple::simvtx_processType
private

Definition at line 669 of file TrackingNtuple.cc.

Referenced by fillTrackingVertices().

std::vector<std::vector<int> > TrackingNtuple::simvtx_sourceSimIdx
private

Definition at line 673 of file TrackingNtuple.cc.

Referenced by clearVariables(), and fillTrackingVertices().

std::vector<float> TrackingNtuple::simvtx_x
private

Definition at line 670 of file TrackingNtuple.cc.

Referenced by clearVariables(), and fillTrackingVertices().

std::vector<float> TrackingNtuple::simvtx_y
private

Definition at line 671 of file TrackingNtuple.cc.

Referenced by clearVariables(), and fillTrackingVertices().

std::vector<float> TrackingNtuple::simvtx_z
private

Definition at line 672 of file TrackingNtuple.cc.

Referenced by clearVariables(), and fillTrackingVertices().

std::vector<float> TrackingNtuple::str_bbxi
private

Definition at line 561 of file TrackingNtuple.cc.

Referenced by clearVariables(), and fillStripRphiStereoHits().

std::vector<std::vector<float> > TrackingNtuple::str_chargeFraction
private

Definition at line 549 of file TrackingNtuple.cc.

Referenced by clearVariables(), and fillStripRphiStereoHits().

std::vector<unsigned short> TrackingNtuple::str_det
private

Definition at line 543 of file TrackingNtuple.cc.

Referenced by clearVariables(), and fillStripRphiStereoHits().

std::vector<unsigned int> TrackingNtuple::str_detId
private

Definition at line 545 of file TrackingNtuple.cc.

Referenced by clearVariables(), and fillStripRphiStereoHits().

std::vector<short> TrackingNtuple::str_isBarrel
private

Definition at line 541 of file TrackingNtuple.cc.

Referenced by clearVariables(), and fillStripRphiStereoHits().

std::vector<short> TrackingNtuple::str_isStereo
private

Definition at line 542 of file TrackingNtuple.cc.

Referenced by clearVariables(), and fillStripRphiStereoHits().

std::vector<unsigned short> TrackingNtuple::str_lay
private

Definition at line 544 of file TrackingNtuple.cc.

Referenced by clearVariables(), and fillStripRphiStereoHits().

std::vector<float> TrackingNtuple::str_radL
private

Definition at line 560 of file TrackingNtuple.cc.

Referenced by clearVariables(), and fillStripRphiStereoHits().

std::vector<std::vector<int> > TrackingNtuple::str_seeIdx
private

Definition at line 547 of file TrackingNtuple.cc.

Referenced by clearVariables(), fillSeeds(), and fillStripRphiStereoHits().

std::vector<std::vector<int> > TrackingNtuple::str_simHitIdx
private

Definition at line 548 of file TrackingNtuple.cc.

Referenced by clearVariables(), and fillStripRphiStereoHits().

std::vector<unsigned short> TrackingNtuple::str_simType
private

Definition at line 550 of file TrackingNtuple.cc.

Referenced by clearVariables(), and fillStripRphiStereoHits().

std::vector<std::vector<int> > TrackingNtuple::str_trkIdx
private

Definition at line 546 of file TrackingNtuple.cc.

Referenced by clearVariables(), fillStripRphiStereoHits(), and fillTracks().

std::vector<float> TrackingNtuple::str_x
private

Definition at line 551 of file TrackingNtuple.cc.

Referenced by clearVariables(), and fillStripRphiStereoHits().

std::vector<float> TrackingNtuple::str_xx
private

Definition at line 554 of file TrackingNtuple.cc.

Referenced by clearVariables(), and fillStripRphiStereoHits().

std::vector<float> TrackingNtuple::str_xy
private

Definition at line 555 of file TrackingNtuple.cc.

Referenced by clearVariables(), and fillStripRphiStereoHits().

std::vector<float> TrackingNtuple::str_y
private

Definition at line 552 of file TrackingNtuple.cc.

Referenced by clearVariables(), and fillStripRphiStereoHits().

std::vector<float> TrackingNtuple::str_yy
private

Definition at line 556 of file TrackingNtuple.cc.

Referenced by clearVariables(), and fillStripRphiStereoHits().

std::vector<float> TrackingNtuple::str_yz
private

Definition at line 557 of file TrackingNtuple.cc.

Referenced by clearVariables(), and fillStripRphiStereoHits().

std::vector<float> TrackingNtuple::str_z
private

Definition at line 553 of file TrackingNtuple.cc.

Referenced by clearVariables(), and fillStripRphiStereoHits().

std::vector<float> TrackingNtuple::str_zx
private

Definition at line 559 of file TrackingNtuple.cc.

Referenced by clearVariables(), and fillStripRphiStereoHits().

std::vector<float> TrackingNtuple::str_zz
private

Definition at line 558 of file TrackingNtuple.cc.

Referenced by clearVariables(), and fillStripRphiStereoHits().

edm::EDGetTokenT<SiStripMatchedRecHit2DCollection> TrackingNtuple::stripMatchedRecHitToken_
private

Definition at line 415 of file TrackingNtuple.cc.

Referenced by fillStripMatchedHits().

edm::EDGetTokenT<SiStripRecHit2DCollection> TrackingNtuple::stripRphiRecHitToken_
private

Definition at line 413 of file TrackingNtuple.cc.

Referenced by fillStripRphiStereoHits().

edm::EDGetTokenT<edm::DetSetVector<StripDigiSimLink> > TrackingNtuple::stripSimLinkToken_
private

Definition at line 410 of file TrackingNtuple.cc.

Referenced by analyze().

edm::EDGetTokenT<SiStripRecHit2DCollection> TrackingNtuple::stripStereoRecHitToken_
private

Definition at line 414 of file TrackingNtuple.cc.

Referenced by fillStripRphiStereoHits().

TTree* TrackingNtuple::t
private

Definition at line 426 of file TrackingNtuple.cc.

Referenced by analyze().

edm::EDGetTokenT<edm::ValueMap<unsigned int> > TrackingNtuple::tpNLayersToken_
private

Definition at line 418 of file TrackingNtuple.cc.

Referenced by fillTrackingParticles().

edm::EDGetTokenT<edm::ValueMap<unsigned int> > TrackingNtuple::tpNPixelLayersToken_
private

Definition at line 419 of file TrackingNtuple.cc.

Referenced by fillTrackingParticles().

edm::EDGetTokenT<edm::ValueMap<unsigned int> > TrackingNtuple::tpNStripStereoLayersToken_
private

Definition at line 420 of file TrackingNtuple.cc.

Referenced by fillTrackingParticles().

edm::EDGetTokenT<reco::TrackToTrackingParticleAssociator> TrackingNtuple::trackAssociatorToken_
private

Definition at line 408 of file TrackingNtuple.cc.

Referenced by analyze().

edm::EDGetTokenT<TrackingParticleRefVector> TrackingNtuple::trackingParticleRefToken_
private

Definition at line 405 of file TrackingNtuple.cc.

Referenced by analyze().

edm::EDGetTokenT<TrackingParticleCollection> TrackingNtuple::trackingParticleToken_
private

Definition at line 404 of file TrackingNtuple.cc.

Referenced by analyze().

edm::EDGetTokenT<TrackingVertexCollection> TrackingNtuple::trackingVertexToken_
private

Definition at line 417 of file TrackingNtuple.cc.

Referenced by analyze().

edm::EDGetTokenT<edm::View<reco::Track> > TrackingNtuple::trackToken_
private

Definition at line 403 of file TrackingNtuple.cc.

Referenced by analyze(), and fillTracks().

std::vector<unsigned int> TrackingNtuple::trk_algo
private

Definition at line 473 of file TrackingNtuple.cc.

Referenced by clearVariables(), and fillTracks().

std::vector<decltype(reco::TrackBase().algoMaskUL())> TrackingNtuple::trk_algoMask
private

Definition at line 475 of file TrackingNtuple.cc.

Referenced by clearVariables(), and fillTracks().

std::vector<float> TrackingNtuple::trk_cotTheta
private

Definition at line 449 of file TrackingNtuple.cc.

Referenced by clearVariables(), and fillTracks().

std::vector<float> TrackingNtuple::trk_dxy
private

Definition at line 451 of file TrackingNtuple.cc.

Referenced by clearVariables(), and fillTracks().

std::vector<float> TrackingNtuple::trk_dxyErr
private

Definition at line 457 of file TrackingNtuple.cc.

Referenced by clearVariables(), and fillTracks().

std::vector<float> TrackingNtuple::trk_dz
private

Definition at line 452 of file TrackingNtuple.cc.

Referenced by clearVariables(), and fillTracks().

std::vector<float> TrackingNtuple::trk_dzErr
private

Definition at line 458 of file TrackingNtuple.cc.

Referenced by clearVariables(), and fillTracks().

std::vector<float> TrackingNtuple::trk_eta
private

Definition at line 447 of file TrackingNtuple.cc.

Referenced by clearVariables(), and fillTracks().

std::vector<float> TrackingNtuple::trk_etaErr
private

Definition at line 454 of file TrackingNtuple.cc.

Referenced by clearVariables(), and fillTracks().

std::vector<std::vector<int> > TrackingNtuple::trk_hitIdx
private

Definition at line 482 of file TrackingNtuple.cc.

Referenced by clearVariables(), and fillTracks().

std::vector<std::vector<int> > TrackingNtuple::trk_hitType
private

Definition at line 483 of file TrackingNtuple.cc.

Referenced by clearVariables(), and fillTracks().

std::vector<float> TrackingNtuple::trk_inner_pt
private

Definition at line 442 of file TrackingNtuple.cc.

Referenced by clearVariables(), and fillTracks().

std::vector<float> TrackingNtuple::trk_inner_px
private

Definition at line 439 of file TrackingNtuple.cc.

Referenced by clearVariables(), and fillTracks().

std::vector<float> TrackingNtuple::trk_inner_py
private

Definition at line 440 of file TrackingNtuple.cc.

Referenced by clearVariables(), and fillTracks().

std::vector<float> TrackingNtuple::trk_inner_pz
private

Definition at line 441 of file TrackingNtuple.cc.

Referenced by clearVariables(), and fillTracks().

std::vector<short> TrackingNtuple::trk_isHP
private

Definition at line 477 of file TrackingNtuple.cc.

Referenced by clearVariables(), and fillTracks().

std::vector<float> TrackingNtuple::trk_lambda
private

Definition at line 448 of file TrackingNtuple.cc.

Referenced by clearVariables(), and fillTracks().

std::vector<float> TrackingNtuple::trk_lambdaErr
private

Definition at line 455 of file TrackingNtuple.cc.

Referenced by clearVariables(), and fillTracks().

std::vector<unsigned int> TrackingNtuple::trk_n3DLay
private

Definition at line 470 of file TrackingNtuple.cc.

Referenced by clearVariables(), and fillTracks().

std::vector<float> TrackingNtuple::trk_nChi2
private

Definition at line 462 of file TrackingNtuple.cc.

Referenced by clearVariables(), and fillTracks().

std::vector<unsigned int> TrackingNtuple::trk_nInnerLost
private

Definition at line 472 of file TrackingNtuple.cc.

Referenced by clearVariables(), and fillTracks().

std::vector<unsigned int> TrackingNtuple::trk_nInvalid
private

Definition at line 465 of file TrackingNtuple.cc.

Referenced by clearVariables(), and fillTracks().

std::vector<unsigned int> TrackingNtuple::trk_nOuterLost
private

Definition at line 471 of file TrackingNtuple.cc.

Referenced by clearVariables(), and fillTracks().

std::vector<unsigned int> TrackingNtuple::trk_nPixel
private

Definition at line 466 of file TrackingNtuple.cc.

Referenced by clearVariables(), and fillTracks().

std::vector<unsigned int> TrackingNtuple::trk_nPixelLay
private

Definition at line 468 of file TrackingNtuple.cc.

Referenced by clearVariables(), and fillTracks().

std::vector<unsigned int> TrackingNtuple::trk_nStrip
private

Definition at line 467 of file TrackingNtuple.cc.

Referenced by clearVariables(), and fillTracks().

std::vector<unsigned int> TrackingNtuple::trk_nStripLay
private

Definition at line 469 of file TrackingNtuple.cc.

Referenced by clearVariables(), and fillTracks().

std::vector<unsigned int> TrackingNtuple::trk_nValid
private

Definition at line 464 of file TrackingNtuple.cc.

Referenced by clearVariables(), and fillTracks().

std::vector<unsigned int> TrackingNtuple::trk_originalAlgo
private

Definition at line 474 of file TrackingNtuple.cc.

Referenced by clearVariables(), and fillTracks().

std::vector<float> TrackingNtuple::trk_outer_pt
private

Definition at line 446 of file TrackingNtuple.cc.

Referenced by clearVariables(), and fillTracks().

std::vector<float> TrackingNtuple::trk_outer_px
private

Definition at line 443 of file TrackingNtuple.cc.

Referenced by clearVariables(), and fillTracks().

std::vector<float> TrackingNtuple::trk_outer_py
private

Definition at line 444 of file TrackingNtuple.cc.

Referenced by clearVariables(), and fillTracks().

std::vector<float> TrackingNtuple::trk_outer_pz
private

Definition at line 445 of file TrackingNtuple.cc.

Referenced by clearVariables(), and fillTracks().

std::vector<float> TrackingNtuple::trk_phi
private

Definition at line 450 of file TrackingNtuple.cc.

Referenced by clearVariables(), and fillTracks().

std::vector<float> TrackingNtuple::trk_phiErr
private

Definition at line 456 of file TrackingNtuple.cc.

Referenced by clearVariables(), and fillTracks().

std::vector<float> TrackingNtuple::trk_pt
private

Definition at line 438 of file TrackingNtuple.cc.

Referenced by clearVariables(), and fillTracks().

std::vector<float> TrackingNtuple::trk_ptErr
private

Definition at line 453 of file TrackingNtuple.cc.

Referenced by clearVariables(), and fillTracks().

std::vector<float> TrackingNtuple::trk_px
private

Definition at line 435 of file TrackingNtuple.cc.

Referenced by clearVariables(), and fillTracks().

std::vector<float> TrackingNtuple::trk_py
private

Definition at line 436 of file TrackingNtuple.cc.

Referenced by clearVariables(), and fillTracks().

std::vector<float> TrackingNtuple::trk_pz
private

Definition at line 437 of file TrackingNtuple.cc.

Referenced by clearVariables(), and fillTracks().

std::vector<int> TrackingNtuple::trk_q
private

Definition at line 463 of file TrackingNtuple.cc.

Referenced by clearVariables(), and fillTracks().

std::vector<float> TrackingNtuple::trk_refpoint_x
private

Definition at line 459 of file TrackingNtuple.cc.

Referenced by clearVariables(), and fillTracks().

std::vector<float> TrackingNtuple::trk_refpoint_y
private

Definition at line 460 of file TrackingNtuple.cc.

Referenced by clearVariables(), and fillTracks().

std::vector<float> TrackingNtuple::trk_refpoint_z
private

Definition at line 461 of file TrackingNtuple.cc.

Referenced by clearVariables(), and fillTracks().

std::vector<int> TrackingNtuple::trk_seedIdx
private

Definition at line 478 of file TrackingNtuple.cc.

Referenced by clearVariables(), and fillTracks().

std::vector<std::vector<float> > TrackingNtuple::trk_shareFrac
private

Definition at line 480 of file TrackingNtuple.cc.

Referenced by clearVariables(), and fillTracks().

std::vector<std::vector<int> > TrackingNtuple::trk_simTrkIdx
private

Definition at line 481 of file TrackingNtuple.cc.

Referenced by clearVariables(), and fillTracks().

std::vector<unsigned int> TrackingNtuple::trk_stopReason
private

Definition at line 476 of file TrackingNtuple.cc.

Referenced by clearVariables(), and fillTracks().

std::vector<int> TrackingNtuple::trk_vtxIdx
private

Definition at line 479 of file TrackingNtuple.cc.

Referenced by clearVariables(), fillTracks(), and fillVertices().

edm::EDGetTokenT<reco::VertexCollection> TrackingNtuple::vertexToken_
private

Definition at line 416 of file TrackingNtuple.cc.

Referenced by analyze().

std::vector<float> TrackingNtuple::vtx_chi2
private

Definition at line 659 of file TrackingNtuple.cc.

Referenced by clearVariables(), and fillVertices().

std::vector<short> TrackingNtuple::vtx_fake
private

Definition at line 660 of file TrackingNtuple.cc.

Referenced by clearVariables(), and fillVertices().

std::vector<float> TrackingNtuple::vtx_ndof
private

Definition at line 658 of file TrackingNtuple.cc.

Referenced by clearVariables(), and fillVertices().

std::vector<std::vector<int> > TrackingNtuple::vtx_trkIdx
private

Definition at line 662 of file TrackingNtuple.cc.

Referenced by clearVariables(), and fillVertices().

std::vector<short> TrackingNtuple::vtx_valid
private

Definition at line 661 of file TrackingNtuple.cc.

Referenced by clearVariables(), and fillVertices().

std::vector<float> TrackingNtuple::vtx_x
private

Definition at line 652 of file TrackingNtuple.cc.

Referenced by clearVariables(), and fillVertices().

std::vector<float> TrackingNtuple::vtx_xErr
private

Definition at line 655 of file TrackingNtuple.cc.

Referenced by clearVariables(), and fillVertices().

std::vector<float> TrackingNtuple::vtx_y
private

Definition at line 653 of file TrackingNtuple.cc.

Referenced by clearVariables(), and fillVertices().

std::vector<float> TrackingNtuple::vtx_yErr
private

Definition at line 656 of file TrackingNtuple.cc.

Referenced by clearVariables(), and fillVertices().

std::vector<float> TrackingNtuple::vtx_z
private

Definition at line 654 of file TrackingNtuple.cc.

Referenced by clearVariables(), and fillVertices().

std::vector<float> TrackingNtuple::vtx_zErr
private

Definition at line 657 of file TrackingNtuple.cc.

Referenced by clearVariables(), and fillVertices().