CMS 3D CMS Logo

List of all members | Public Member Functions | Private Member Functions | Private Attributes
OverlapProblemTSOSAnalyzer Class Reference

#include <DebugTools/OverlapProblem/plugins/OverlapProblemTSOSAnalyzer.cc>

Inheritance diagram for OverlapProblemTSOSAnalyzer:
edm::EDAnalyzer edm::EDConsumerBase

Public Member Functions

 OverlapProblemTSOSAnalyzer (const edm::ParameterSet &)
 
 ~OverlapProblemTSOSAnalyzer () override
 
- Public Member Functions inherited from edm::EDAnalyzer
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
 EDAnalyzer ()
 
SerialTaskQueueglobalLuminosityBlocksQueue ()
 
SerialTaskQueueglobalRunsQueue ()
 
ModuleDescription const & moduleDescription () const
 
std::string workerType () const
 
 ~EDAnalyzer () override
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
void convertCurrentProcessAlias (std::string const &processName)
 Convert "@currentProcess" in InputTag process names to the actual current process name. More...
 
 EDConsumerBase ()
 
 EDConsumerBase (EDConsumerBase &&)=default
 
 EDConsumerBase (EDConsumerBase const &)=delete
 
ESProxyIndex const * esGetTokenIndices (edm::Transition iTrans) const
 
std::vector< ESProxyIndex > const & esGetTokenIndicesVector (edm::Transition iTrans) const
 
std::vector< ESRecordIndex > const & esGetTokenRecordIndicesVector (edm::Transition iTrans) const
 
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 & itemsToGetFrom (BranchType iType) const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesWhoseProductsAreConsumed (std::array< std::vector< ModuleDescription const * > *, NumBranchTypes > &modulesAll, std::vector< ModuleProcessName > &modulesInPreviousProcesses, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
bool registeredToConsume (ProductResolverIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void selectInputProcessBlocks (ProductRegistry const &productRegistry, ProcessBlockHelperBase const &processBlockHelperBase)
 
ProductResolverIndexAndSkipBit uncheckedIndexFrom (EDGetToken) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
void updateLookup (eventsetup::ESRecordsToProxyIndices const &)
 
virtual ~EDConsumerBase () noexcept(false)
 

Private Member Functions

void analyze (const edm::Event &, const edm::EventSetup &) override
 
void beginRun (const edm::Run &, const edm::EventSetup &) override
 
void endRun (const edm::Run &, const edm::EventSetup &) override
 

Private Attributes

const bool m_debug
 
TH1F * m_etatrk
 
TH1F * m_ptrk
 
TSOSHistogramMaker m_tsoshm
 
edm::EDGetTokenT< TrajTrackAssociationCollectionm_ttacollToken
 
bool m_validOnly
 

Additional Inherited Members

- Public Types inherited from edm::EDAnalyzer
typedef EDAnalyzer ModuleType
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- Static Public Member Functions inherited from edm::EDAnalyzer
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &)
 
static bool wantsGlobalLuminosityBlocks ()
 
static bool wantsGlobalRuns ()
 
static bool wantsInputProcessBlocks ()
 
static bool wantsProcessBlocks ()
 
static bool wantsStreamLuminosityBlocks ()
 
static bool wantsStreamRuns ()
 
- Protected Member Functions inherited from edm::EDConsumerBase
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
template<BranchType B = InEvent>
EDConsumerBaseAdaptor< B > consumes (edm::InputTag tag) noexcept
 
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 ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes ()
 
template<Transition Tr = Transition::Event>
constexpr auto esConsumes () noexcept
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes (ESInputTag const &tag)
 
template<Transition Tr = Transition::Event>
auto esConsumes (ESInputTag tag) noexcept
 
template<Transition Tr = Transition::Event>
ESGetTokenGeneric esConsumes (eventsetup::EventSetupRecordKey const &iRecord, eventsetup::DataKey const &iKey)
 Used with EventSetupRecord::doGet. More...
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 

Detailed Description

Description: <one line="" class="" summary>="">

Implementation: <Notes on="" implementation>="">

Definition at line 64 of file OverlapProblemTSOSAnalyzer.cc.

Constructor & Destructor Documentation

◆ OverlapProblemTSOSAnalyzer()

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

Definition at line 97 of file OverlapProblemTSOSAnalyzer.cc.

98  : m_validOnly(iConfig.getParameter<bool>("onlyValidRecHit")),
100  consumes<TrajTrackAssociationCollection>(iConfig.getParameter<edm::InputTag>("trajTrackAssoCollection"))),
101  m_debug(iConfig.getUntrackedParameter<bool>("debugMode", false)),
102  m_tsoshm(iConfig.getParameter<edm::ParameterSet>("tsosHMConf")) {
103  //now do what ever initialization is needed
104 
106 
107  m_ptrk = tfserv->make<TH1F>("trkmomentum", "Refitted Track momentum", 100, 0., 200.);
108  m_etatrk = tfserv->make<TH1F>("trketa", "Refitted Track pseudorapidity", 100, -4., 4.);
109 }

References m_etatrk, m_ptrk, and TFileService::make().

◆ ~OverlapProblemTSOSAnalyzer()

OverlapProblemTSOSAnalyzer::~OverlapProblemTSOSAnalyzer ( )
override

Definition at line 111 of file OverlapProblemTSOSAnalyzer.cc.

111  {
112  // do anything here that needs to be done at desctruction time
113  // (e.g. close files, deallocate resources etc.)
114 }

Member Function Documentation

◆ analyze()

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

Implements edm::EDAnalyzer.

Definition at line 121 of file OverlapProblemTSOSAnalyzer.cc.

121  {
122  using namespace edm;
123 
124  // loop on trajectories and plot TSOS local coordinate
125 
126  TrajectoryStateCombiner tsoscomb;
127 
128  // Trajectory Handle
129 
130  DetIdSelector selector("0x1fbff004-0x14ac1004");
131 
133  iEvent.getByToken(m_ttacollToken, ttac);
134 
135  for (TrajTrackAssociationCollection::const_iterator pair = ttac->begin(); pair != ttac->end(); ++pair) {
136  const edm::Ref<std::vector<Trajectory> >& traj = pair->key;
137  const reco::TrackRef& trk = pair->val;
138  const std::vector<TrajectoryMeasurement>& tmcoll = traj->measurements();
139 
140  m_ptrk->Fill(trk->p());
141  m_etatrk->Fill(trk->eta());
142 
143  for (std::vector<TrajectoryMeasurement>::const_iterator meas = tmcoll.begin(); meas != tmcoll.end(); ++meas) {
144  if (!meas->updatedState().isValid())
145  continue;
146 
147  TrajectoryStateOnSurface tsos = tsoscomb(meas->forwardPredictedState(), meas->backwardPredictedState());
149 
150  m_tsoshm.fill(tsos, hit);
151 
152  if (!hit->isValid() && m_validOnly)
153  continue;
154 
155  if (m_debug) {
156  if (selector.isSelected(hit->geographicalId())) {
157  const SiPixelRecHit* pixelrh = dynamic_cast<const SiPixelRecHit*>(hit->hit());
158  if (pixelrh) {
159  edm::LogInfo("ClusterFound") << "Cluster reference" << pixelrh->cluster().key();
160  } else {
161  edm::LogInfo("NoCluster") << "No cluster found!";
162  }
163  }
164  }
165  }
166  }
167 }

References edm::AssociationMap< Tag >::begin(), SiPixelRecHit::cluster(), edm::AssociationMap< edm::OneToOne< std::vector< Trajectory >, reco::TrackCollection, unsigned short > >::const_iterator, edm::AssociationMap< Tag >::end(), TSOSHistogramMaker::fill(), iEvent, DetIdSelector::isSelected(), edm::Ref< C, T, F >::key(), m_debug, m_etatrk, m_ptrk, m_tsoshm, m_ttacollToken, and m_validOnly.

◆ beginRun()

void OverlapProblemTSOSAnalyzer::beginRun ( const edm::Run iRun,
const edm::EventSetup  
)
overrideprivatevirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 169 of file OverlapProblemTSOSAnalyzer.cc.

169 {}

◆ endRun()

void OverlapProblemTSOSAnalyzer::endRun ( const edm::Run iRun,
const edm::EventSetup  
)
overrideprivatevirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 171 of file OverlapProblemTSOSAnalyzer.cc.

171 {}

Member Data Documentation

◆ m_debug

const bool OverlapProblemTSOSAnalyzer::m_debug
private

Definition at line 81 of file OverlapProblemTSOSAnalyzer.cc.

Referenced by analyze().

◆ m_etatrk

TH1F* OverlapProblemTSOSAnalyzer::m_etatrk
private

Definition at line 77 of file OverlapProblemTSOSAnalyzer.cc.

Referenced by analyze(), and OverlapProblemTSOSAnalyzer().

◆ m_ptrk

TH1F* OverlapProblemTSOSAnalyzer::m_ptrk
private

Definition at line 76 of file OverlapProblemTSOSAnalyzer.cc.

Referenced by analyze(), and OverlapProblemTSOSAnalyzer().

◆ m_tsoshm

TSOSHistogramMaker OverlapProblemTSOSAnalyzer::m_tsoshm
private

Definition at line 83 of file OverlapProblemTSOSAnalyzer.cc.

Referenced by analyze().

◆ m_ttacollToken

edm::EDGetTokenT<TrajTrackAssociationCollection> OverlapProblemTSOSAnalyzer::m_ttacollToken
private

Definition at line 80 of file OverlapProblemTSOSAnalyzer.cc.

Referenced by analyze().

◆ m_validOnly

bool OverlapProblemTSOSAnalyzer::m_validOnly
private

Definition at line 79 of file OverlapProblemTSOSAnalyzer.cc.

Referenced by analyze().

OverlapProblemTSOSAnalyzer::m_debug
const bool m_debug
Definition: OverlapProblemTSOSAnalyzer.cc:81
edm
HLT enums.
Definition: AlignableModifier.h:19
edm::ParameterSet::getUntrackedParameter
T getUntrackedParameter(std::string const &, T const &) const
edm::LogInfo
Log< level::Info, false > LogInfo
Definition: MessageLogger.h:125
edm::Handle
Definition: AssociativeIterator.h:50
SiPixelRecHit::cluster
ClusterRef cluster() const
Definition: SiPixelRecHit.h:47
SiPixelRecHit
Our base class.
Definition: SiPixelRecHit.h:23
edm::Ref
Definition: AssociativeIterator.h:58
edm::AssociationMap::end
const_iterator end() const
last iterator over the map (read only)
Definition: AssociationMap.h:171
TrajectoryStateOnSurface
Definition: TrajectoryStateOnSurface.h:16
OverlapProblemTSOSAnalyzer::m_validOnly
bool m_validOnly
Definition: OverlapProblemTSOSAnalyzer.cc:79
edm::AssociationMap< edm::OneToOne< std::vector< Trajectory >, reco::TrackCollection, unsigned short > >::const_iterator
friend struct const_iterator
Definition: AssociationMap.h:274
TrajectoryStateCombiner
Definition: TrajectoryStateCombiner.h:13
edm::ParameterSet
Definition: ParameterSet.h:47
TSOSHistogramMaker::fill
void fill(const TrajectoryStateOnSurface &tsos, TransientTrackingRecHit::ConstRecHitPointer hit) const
Definition: TSOSHistogramMaker.cc:110
TrackingRecHit::ConstRecHitPointer
std::shared_ptr< TrackingRecHit const > ConstRecHitPointer
Definition: TrackingRecHit.h:25
edm::Service< TFileService >
OverlapProblemTSOSAnalyzer::m_etatrk
TH1F * m_etatrk
Definition: OverlapProblemTSOSAnalyzer.cc:77
iEvent
int iEvent
Definition: GenABIO.cc:224
TFileService::make
T * make(const Args &...args) const
make new ROOT object
Definition: TFileService.h:64
OverlapProblemTSOSAnalyzer::m_tsoshm
TSOSHistogramMaker m_tsoshm
Definition: OverlapProblemTSOSAnalyzer.cc:83
edm::AssociationMap::begin
const_iterator begin() const
first iterator over the map (read only)
Definition: AssociationMap.h:169
OverlapProblemTSOSAnalyzer::m_ttacollToken
edm::EDGetTokenT< TrajTrackAssociationCollection > m_ttacollToken
Definition: OverlapProblemTSOSAnalyzer.cc:80
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
edm::Ref::key
key_type key() const
Accessor for product key.
Definition: Ref.h:250
OverlapProblemTSOSAnalyzer::m_ptrk
TH1F * m_ptrk
Definition: OverlapProblemTSOSAnalyzer.cc:76
edm::InputTag
Definition: InputTag.h:15
DetIdSelector
Definition: DetIdSelector.h:12
hit
Definition: SiStripHitEffFromCalibTree.cc:88