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 const &)=delete
 
 EDConsumerBase (EDConsumerBase &&)=default
 
ESProxyIndex const * esGetTokenIndices (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::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
 
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 wantsStreamLuminosityBlocks ()
 
static bool wantsStreamRuns ()
 
- 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 ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes ()
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes (ESInputTag const &tag)
 
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 64 of file OverlapProblemTSOSAnalyzer.cc.

Constructor & Destructor Documentation

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

Definition at line 97 of file OverlapProblemTSOSAnalyzer.cc.

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

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 }
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
T * make(const Args &...args) const
make new ROOT object
Definition: TFileService.h:64
edm::EDGetTokenT< TrajTrackAssociationCollection > m_ttacollToken
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

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

Definition at line 121 of file OverlapProblemTSOSAnalyzer.cc.

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(), edm::Event::getByToken(), DetIdSelector::isSelected(), edm::Ref< C, T, F >::key(), m_debug, m_etatrk, m_ptrk, m_tsoshm, m_ttacollToken, and m_validOnly.

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 }
const_iterator end() const
last iterator over the map (read only)
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:525
void fill(const TrajectoryStateOnSurface &tsos, TransientTrackingRecHit::ConstRecHitPointer hit) const
key_type key() const
Accessor for product key.
Definition: Ref.h:250
std::shared_ptr< TrackingRecHit const > ConstRecHitPointer
edm::EDGetTokenT< TrajTrackAssociationCollection > m_ttacollToken
ClusterRef cluster() const
Definition: SiPixelRecHit.h:47
HLT enums.
const_iterator begin() const
first iterator over the map (read only)
Our base class.
Definition: SiPixelRecHit.h:23
void OverlapProblemTSOSAnalyzer::beginRun ( const edm::Run iRun,
const edm::EventSetup  
)
overrideprivate

Definition at line 169 of file OverlapProblemTSOSAnalyzer.cc.

169 {}
void OverlapProblemTSOSAnalyzer::endRun ( const edm::Run iRun,
const edm::EventSetup  
)
overrideprivate

Definition at line 171 of file OverlapProblemTSOSAnalyzer.cc.

References DEFINE_FWK_MODULE.

171 {}

Member Data Documentation

const bool OverlapProblemTSOSAnalyzer::m_debug
private

Definition at line 81 of file OverlapProblemTSOSAnalyzer.cc.

Referenced by analyze().

TH1F* OverlapProblemTSOSAnalyzer::m_etatrk
private

Definition at line 77 of file OverlapProblemTSOSAnalyzer.cc.

Referenced by analyze(), and OverlapProblemTSOSAnalyzer().

TH1F* OverlapProblemTSOSAnalyzer::m_ptrk
private

Definition at line 76 of file OverlapProblemTSOSAnalyzer.cc.

Referenced by analyze(), and OverlapProblemTSOSAnalyzer().

TSOSHistogramMaker OverlapProblemTSOSAnalyzer::m_tsoshm
private

Definition at line 83 of file OverlapProblemTSOSAnalyzer.cc.

Referenced by analyze().

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

Definition at line 80 of file OverlapProblemTSOSAnalyzer.cc.

Referenced by analyze().

bool OverlapProblemTSOSAnalyzer::m_validOnly
private

Definition at line 79 of file OverlapProblemTSOSAnalyzer.cc.

Referenced by analyze().