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 66 of file OverlapProblemTSOSAnalyzer.cc.

Constructor & Destructor Documentation

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

Definition at line 100 of file OverlapProblemTSOSAnalyzer.cc.

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

100  :
101  m_validOnly(iConfig.getParameter<bool>("onlyValidRecHit")),
102  m_ttacollToken(consumes<TrajTrackAssociationCollection>(iConfig.getParameter<edm::InputTag>("trajTrackAssoCollection"))),
103  m_debug(iConfig.getUntrackedParameter<bool>("debugMode",false)),
104  m_tsoshm(iConfig.getParameter<edm::ParameterSet>("tsosHMConf"))
105 {
106  //now do what ever initialization is needed
107 
108 
109 
111 
112  m_ptrk = tfserv->make<TH1F>("trkmomentum","Refitted Track momentum",100,0.,200.);
113  m_etatrk = tfserv->make<TH1F>("trketa","Refitted Track pseudorapidity",100,-4.,4.);
114 
115 
116 }
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 119 of file OverlapProblemTSOSAnalyzer.cc.

120 {
121 
122  // do anything here that needs to be done at desctruction time
123  // (e.g. close files, deallocate resources etc.)
124 
125 }

Member Function Documentation

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

Definition at line 134 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.

135 {
136  using namespace edm;
137 
138  // loop on trajectories and plot TSOS local coordinate
139 
140  TrajectoryStateCombiner tsoscomb;
141 
142  // Trajectory Handle
143 
144  DetIdSelector selector("0x1fbff004-0x14ac1004");
145 
147  iEvent.getByToken(m_ttacollToken,ttac);
148 
149  for(TrajTrackAssociationCollection::const_iterator pair=ttac->begin();pair!=ttac->end();++pair) {
150 
151  const edm::Ref<std::vector<Trajectory> > & traj = pair->key;
152  const reco::TrackRef & trk = pair->val;
153  const std::vector<TrajectoryMeasurement> & tmcoll = traj->measurements();
154 
155  m_ptrk->Fill(trk->p());
156  m_etatrk->Fill(trk->eta());
157 
158 
159  for(std::vector<TrajectoryMeasurement>::const_iterator meas = tmcoll.begin() ; meas!= tmcoll.end() ; ++meas) {
160 
161  if(!meas->updatedState().isValid()) continue;
162 
163  TrajectoryStateOnSurface tsos = tsoscomb(meas->forwardPredictedState(), meas->backwardPredictedState());
165 
166  m_tsoshm.fill(tsos,hit);
167 
168  if(!hit->isValid() && m_validOnly) continue;
169 
170  if(m_debug) {
171  if(selector.isSelected(hit->geographicalId())) {
172  const SiPixelRecHit* pixelrh = dynamic_cast<const SiPixelRecHit*>(hit->hit());
173  if(pixelrh) {
174  edm::LogInfo("ClusterFound") << "Cluster reference" << pixelrh->cluster().key();
175  }
176  else {
177  edm::LogInfo("NoCluster") << "No cluster found!";
178  }
179  }
180  }
181 
182  }
183 
184  }
185 
186 
187 }
const_iterator end() const
last iterator over the map (read only)
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:517
void fill(const TrajectoryStateOnSurface &tsos, TransientTrackingRecHit::ConstRecHitPointer hit) const
key_type key() const
Accessor for product key.
Definition: Ref.h:263
std::shared_ptr< TrackingRecHit const > ConstRecHitPointer
edm::EDGetTokenT< TrajTrackAssociationCollection > m_ttacollToken
ClusterRef cluster() const
Definition: SiPixelRecHit.h:49
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 190 of file OverlapProblemTSOSAnalyzer.cc.

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

Definition at line 195 of file OverlapProblemTSOSAnalyzer.cc.

References DEFINE_FWK_MODULE.

196 {
197 }

Member Data Documentation

const bool OverlapProblemTSOSAnalyzer::m_debug
private

Definition at line 83 of file OverlapProblemTSOSAnalyzer.cc.

Referenced by analyze().

TH1F* OverlapProblemTSOSAnalyzer::m_etatrk
private

Definition at line 79 of file OverlapProblemTSOSAnalyzer.cc.

Referenced by analyze(), and OverlapProblemTSOSAnalyzer().

TH1F* OverlapProblemTSOSAnalyzer::m_ptrk
private

Definition at line 78 of file OverlapProblemTSOSAnalyzer.cc.

Referenced by analyze(), and OverlapProblemTSOSAnalyzer().

TSOSHistogramMaker OverlapProblemTSOSAnalyzer::m_tsoshm
private

Definition at line 85 of file OverlapProblemTSOSAnalyzer.cc.

Referenced by analyze().

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

Definition at line 82 of file OverlapProblemTSOSAnalyzer.cc.

Referenced by analyze().

bool OverlapProblemTSOSAnalyzer::m_validOnly
private

Definition at line 81 of file OverlapProblemTSOSAnalyzer.cc.

Referenced by analyze().