CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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 ()
 
- Public Member Functions inherited from edm::EDAnalyzer
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
 EDAnalyzer ()
 
ModuleDescription const & moduleDescription () const
 
std::string workerType () const
 
virtual ~EDAnalyzer ()
 
- Public Member Functions inherited from edm::EDConsumerBase
 EDConsumerBase ()
 
ProductHolderIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
std::vector
< ProductHolderIndexAndSkipBit >
const & 
itemsToGetFromEvent () const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesDependentUpon (const std::string &iProcessName, std::vector< const char * > &oModuleLabels) const
 
bool registeredToConsume (ProductHolderIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void updateLookup (BranchType iBranchType, ProductHolderIndexHelper const &)
 
virtual ~EDConsumerBase ()
 

Private Member Functions

virtual void analyze (const edm::Event &, const edm::EventSetup &) override
 
virtual void beginRun (const edm::Run &, const edm::EventSetup &) override
 
virtual 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
< TrajTrackAssociationCollection
m_ttacollToken
 
bool m_validOnly
 

Additional Inherited Members

- Public Types inherited from edm::EDAnalyzer
typedef EDAnalyzer ModuleType
 
- Static Public Member Functions inherited from edm::EDAnalyzer
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &)
 
- 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 67 of file OverlapProblemTSOSAnalyzer.cc.

Constructor & Destructor Documentation

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

Definition at line 101 of file OverlapProblemTSOSAnalyzer.cc.

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

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

Definition at line 120 of file OverlapProblemTSOSAnalyzer.cc.

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

Member Function Documentation

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

Implements edm::EDAnalyzer.

Definition at line 135 of file OverlapProblemTSOSAnalyzer.cc.

References edm::AssociationMap< edm::OneToOne< std::vector< Trajectory >, reco::TrackCollection, unsigned short > >::const_iterator, 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.

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

Reimplemented from edm::EDAnalyzer.

Definition at line 191 of file OverlapProblemTSOSAnalyzer.cc.

192 {
193 }
void OverlapProblemTSOSAnalyzer::endRun ( const edm::Run iRun,
const edm::EventSetup  
)
overrideprivatevirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 196 of file OverlapProblemTSOSAnalyzer.cc.

197 {
198 }

Member Data Documentation

const bool OverlapProblemTSOSAnalyzer::m_debug
private

Definition at line 84 of file OverlapProblemTSOSAnalyzer.cc.

Referenced by analyze().

TH1F* OverlapProblemTSOSAnalyzer::m_etatrk
private

Definition at line 80 of file OverlapProblemTSOSAnalyzer.cc.

Referenced by analyze(), and OverlapProblemTSOSAnalyzer().

TH1F* OverlapProblemTSOSAnalyzer::m_ptrk
private

Definition at line 79 of file OverlapProblemTSOSAnalyzer.cc.

Referenced by analyze(), and OverlapProblemTSOSAnalyzer().

TSOSHistogramMaker OverlapProblemTSOSAnalyzer::m_tsoshm
private

Definition at line 86 of file OverlapProblemTSOSAnalyzer.cc.

Referenced by analyze().

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

Definition at line 83 of file OverlapProblemTSOSAnalyzer.cc.

Referenced by analyze().

bool OverlapProblemTSOSAnalyzer::m_validOnly
private

Definition at line 82 of file OverlapProblemTSOSAnalyzer.cc.

Referenced by analyze().