CMS 3D CMS Logo

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

#include <myTKAnalyses/TrackRecoMonitoring/src/SeedMultiplicityAnalyzer.cc>

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

Classes

class  FromTrackRefSeedFilter
 

Public Member Functions

 SeedMultiplicityAnalyzer (const edm::ParameterSet &)
 
 ~SeedMultiplicityAnalyzer () override
 
- Public Member Functions inherited from edm::one::EDAnalyzer< edm::one::SharedResources >
 EDAnalyzer ()=default
 
 EDAnalyzer (const EDAnalyzer &)=delete
 
SerialTaskQueueglobalLuminosityBlocksQueue () final
 
SerialTaskQueueglobalRunsQueue () final
 
const EDAnalyzeroperator= (const EDAnalyzer &)=delete
 
bool wantsGlobalLuminosityBlocks () const final
 
bool wantsGlobalRuns () const final
 
bool wantsInputProcessBlocks () const final
 
bool wantsProcessBlocks () const final
 
- Public Member Functions inherited from edm::one::EDAnalyzerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
 EDAnalyzerBase ()
 
ModuleDescription const & moduleDescription () const
 
bool wantsStreamLuminosityBlocks () const
 
bool wantsStreamRuns () const
 
 ~EDAnalyzerBase () 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
 
ESResolverIndex const * esGetTokenIndices (edm::Transition iTrans) const
 
std::vector< ESResolverIndex > 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
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
bool registeredToConsume (ProductResolverIndex, bool, 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::ESRecordsToProductResolverIndices const &)
 
virtual ~EDConsumerBase () noexcept(false)
 

Private Member Functions

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

Private Attributes

std::vector< unsigned int > _binseta
 
std::vector< unsigned int > _binsmult
 
std::vector< TH2F * > _hbpixcluslenangle
 
std::vector< TH2F * > _hbpixclusleneta
 
std::vector< TH2F * > _hfpixcluslenangle
 
std::vector< TH2F * > _hfpixclusleneta
 
std::vector< TH1F * > _hpixelrhmult
 
std::vector< TH1F * > _hseedeta
 
std::vector< std::vector< TH2F * > > _hseedeta2D
 
std::vector< TH1F * > _hseedmult
 
std::vector< std::vector< TH2F * > > _hseedmult2D
 
std::vector< TH2F * > _hseedphieta
 
std::vector< std::string > _labels
 
edm::ESGetToken< MagneticField, IdealMagneticFieldRecord_magFieldToken
 
std::vector< double > _maxs
 
std::vector< edm::EDGetTokenT< std::map< unsigned int, int > > > _multiplicityMapTokens
 
std::vector< unsigned int > _seedbins
 
std::vector< edm::EDGetTokenT< TrajectorySeedCollection > > _seedcollTokens
 
std::vector< FromTrackRefSeedFilter_seedfilters
 
std::vector< double > _seedmax
 
std::vector< unsigned int > _selections
 
edm::ESGetToken< TransientTrackingRecHitBuilder, TransientRecHitRecord_TTRHBuilderToken
 

Additional Inherited Members

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

Detailed Description

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

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

Definition at line 69 of file SeedMultiplicityAnalyzer.cc.

Constructor & Destructor Documentation

◆ SeedMultiplicityAnalyzer()

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

Definition at line 131 of file SeedMultiplicityAnalyzer.cc.

References edm::ParameterSet::getParameter(), and AlCaHLTBitMon_QueryRunRegistry::string.

132  : _magFieldToken(esConsumes(edm::ESInputTag{"", iConfig.getParameter<std::string>("TTRHBuilder")})),
134  _seedcollTokens(),
135  _seedbins(),
136  _seedmax(),
137  _seedfilters(),
139  _labels(),
140  _selections(),
141  _binsmult(),
142  _binseta(),
143  _maxs(),
144  _hseedmult2D(),
145  _hseedeta2D() {
146  //now do what ever initialization is needed
147  usesResource(TFileService::kSharedResource);
148 
149  //
150 
151  std::vector<edm::ParameterSet> seedCollectionConfigs =
152  iConfig.getParameter<std::vector<edm::ParameterSet>>("seedCollections");
153 
154  for (std::vector<edm::ParameterSet>::const_iterator scps = seedCollectionConfigs.begin();
155  scps != seedCollectionConfigs.end();
156  ++scps) {
157  _seedcollTokens.push_back(consumes<TrajectorySeedCollection>(scps->getParameter<edm::InputTag>("src")));
158  _seedbins.push_back(scps->getUntrackedParameter<unsigned int>("nBins", 1000));
159  _seedmax.push_back(scps->getUntrackedParameter<double>("maxValue", 100000.));
160 
161  if (scps->exists("trackFilter")) {
162  _seedfilters.push_back(
163  FromTrackRefSeedFilter(consumesCollector(), scps->getParameter<edm::ParameterSet>("trackFilter")));
164  } else {
165  _seedfilters.push_back(FromTrackRefSeedFilter());
166  }
167  }
168 
169  std::vector<edm::ParameterSet> correlationConfigs =
170  iConfig.getParameter<std::vector<edm::ParameterSet>>("multiplicityCorrelations");
171 
172  for (std::vector<edm::ParameterSet>::const_iterator ps = correlationConfigs.begin(); ps != correlationConfigs.end();
173  ++ps) {
174  _multiplicityMapTokens.push_back(
175  consumes<std::map<unsigned int, int>>(ps->getParameter<edm::InputTag>("multiplicityMap")));
176  _labels.push_back(ps->getParameter<std::string>("detLabel"));
177  _selections.push_back(ps->getParameter<unsigned int>("detSelection"));
178  _binsmult.push_back(ps->getParameter<unsigned int>("nBins"));
179  _binseta.push_back(ps->getParameter<unsigned int>("nBinsEta"));
180  _maxs.push_back(ps->getParameter<double>("maxValue"));
181  }
182 
184 
185  std::vector<unsigned int>::const_iterator nseedbins = _seedbins.begin();
186  std::vector<double>::const_iterator seedmax = _seedmax.begin();
187  std::vector<FromTrackRefSeedFilter>::const_iterator filter = _seedfilters.begin();
188 
189  for (std::vector<edm::ParameterSet>::const_iterator scps = seedCollectionConfigs.begin();
190  scps != seedCollectionConfigs.end();
191  ++scps, ++nseedbins, ++seedmax, ++filter) {
192  std::string extendedlabel = std::string(scps->getParameter<edm::InputTag>("src").encode()) + filter->suffix();
193 
194  std::string hname = extendedlabel + std::string("_mult");
195  std::string htitle = extendedlabel + std::string(" seed multiplicity");
196  _hseedmult.push_back(tfserv->make<TH1F>(
197  hname.c_str(), htitle.c_str(), *nseedbins + 1, 0.5 - *seedmax / (*nseedbins), *seedmax + 0.5));
198  _hseedmult[_hseedmult.size() - 1]->GetXaxis()->SetTitle("seeds");
199  _hseedmult[_hseedmult.size() - 1]->GetYaxis()->SetTitle("events");
200 
201  hname = extendedlabel + std::string("_eta");
202  htitle = extendedlabel + std::string(" seed pseudorapidity");
203  _hseedeta.push_back(tfserv->make<TH1F>(hname.c_str(), htitle.c_str(), 80, -4., 4.));
204  _hseedeta[_hseedeta.size() - 1]->GetXaxis()->SetTitle("#eta");
205  _hseedeta[_hseedeta.size() - 1]->GetYaxis()->SetTitle("seeds");
206 
207  hname = extendedlabel + std::string("_phieta");
208  htitle = extendedlabel + std::string(" seed phi vs pseudorapidity");
209  _hseedphieta.push_back(tfserv->make<TH2F>(hname.c_str(), htitle.c_str(), 80, -4., 4., 80, -M_PI, M_PI));
210  _hseedphieta[_hseedphieta.size() - 1]->GetXaxis()->SetTitle("#eta");
211  _hseedphieta[_hseedphieta.size() - 1]->GetYaxis()->SetTitle("#phi");
212 
213  _hseedmult2D.push_back(std::vector<TH2F*>());
214  _hseedeta2D.push_back(std::vector<TH2F*>());
215 
216  hname = extendedlabel + std::string("_npixelrh");
217  htitle = extendedlabel + std::string(" seed SiPixelRecHit multiplicity");
218  _hpixelrhmult.push_back(tfserv->make<TH1F>(hname.c_str(), htitle.c_str(), 5, -.5, 4.5));
219  _hpixelrhmult[_hpixelrhmult.size() - 1]->GetXaxis()->SetTitle("NRecHits");
220  _hpixelrhmult[_hpixelrhmult.size() - 1]->GetYaxis()->SetTitle("seeds");
221 
222  hname = extendedlabel + std::string("_bpixleneta");
223  htitle = extendedlabel + std::string(" seed BPIX cluster length vs pseudorapidity");
224  _hbpixclusleneta.push_back(tfserv->make<TH2F>(hname.c_str(), htitle.c_str(), 80, -4., 4., 40, -0.5, 39.5));
225  _hbpixclusleneta[_hbpixclusleneta.size() - 1]->GetXaxis()->SetTitle("#eta");
226  _hbpixclusleneta[_hbpixclusleneta.size() - 1]->GetYaxis()->SetTitle("length");
227 
228  hname = extendedlabel + std::string("_fpixleneta");
229  htitle = extendedlabel + std::string(" seed FPIX cluster length vs pseudorapidity");
230  _hfpixclusleneta.push_back(tfserv->make<TH2F>(hname.c_str(), htitle.c_str(), 80, -4., 4., 40, -0.5, 39.5));
231  _hfpixclusleneta[_hfpixclusleneta.size() - 1]->GetXaxis()->SetTitle("#eta");
232  _hfpixclusleneta[_hfpixclusleneta.size() - 1]->GetYaxis()->SetTitle("length");
233 
234  hname = extendedlabel + std::string("_bpixlenangle");
235  htitle = extendedlabel + std::string(" seed BPIX cluster length vs track projection");
236  _hbpixcluslenangle.push_back(tfserv->make<TH2F>(hname.c_str(), htitle.c_str(), 200, -1., 1., 40, -0.5, 39.5));
237  _hbpixcluslenangle[_hbpixcluslenangle.size() - 1]->GetXaxis()->SetTitle("projection");
238  _hbpixcluslenangle[_hbpixcluslenangle.size() - 1]->GetYaxis()->SetTitle("length");
239 
240  hname = extendedlabel + std::string("_fpixlenangle");
241  htitle = extendedlabel + std::string(" seed FPIX cluster length vs track projection");
242  _hfpixcluslenangle.push_back(tfserv->make<TH2F>(hname.c_str(), htitle.c_str(), 200, -1., 1., 40, -0.5, 39.5));
243  _hfpixcluslenangle[_hfpixcluslenangle.size() - 1]->GetXaxis()->SetTitle("projection");
244  _hfpixcluslenangle[_hfpixcluslenangle.size() - 1]->GetYaxis()->SetTitle("length");
245 
246  for (unsigned int i = 0; i < _multiplicityMapTokens.size(); ++i) {
247  std::string hname2D = extendedlabel + _labels[i];
248  hname2D += "_mult";
249  std::string htitle2D = extendedlabel + " seeds multiplicity";
250  htitle2D += " vs ";
251  htitle2D += _labels[i];
252  htitle2D += " hits";
253  _hseedmult2D[_hseedmult2D.size() - 1].push_back(tfserv->make<TH2F>(hname2D.c_str(),
254  htitle2D.c_str(),
255  _binsmult[i],
256  0.,
257  _maxs[i],
258  *nseedbins + 1,
259  0.5 - *seedmax / (*nseedbins),
260  *seedmax + 0.5));
261  _hseedmult2D[_hseedmult2D.size() - 1][_hseedmult2D[_hseedmult2D.size() - 1].size() - 1]->GetXaxis()->SetTitle(
262  "hits");
263  _hseedmult2D[_hseedmult2D.size() - 1][_hseedmult2D[_hseedmult2D.size() - 1].size() - 1]->GetYaxis()->SetTitle(
264  "seeds");
265 
266  hname2D = extendedlabel + _labels[i];
267  hname2D += "_eta";
268  htitle2D = extendedlabel + " seeds pseudorapidity";
269  htitle2D += " vs ";
270  htitle2D += _labels[i];
271  htitle2D += " hits";
272  _hseedeta2D[_hseedeta2D.size() - 1].push_back(
273  tfserv->make<TH2F>(hname2D.c_str(), htitle2D.c_str(), _binseta[i], 0., _maxs[i], 80, -4., 4.));
274  _hseedeta2D[_hseedeta2D.size() - 1][_hseedeta2D[_hseedeta2D.size() - 1].size() - 1]->GetXaxis()->SetTitle("hits");
275  _hseedeta2D[_hseedeta2D.size() - 1][_hseedeta2D[_hseedeta2D.size() - 1].size() - 1]->GetYaxis()->SetTitle("#eta");
276  }
277  }
278 }
static const std::string kSharedResource
Definition: TFileService.h:76
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
std::vector< FromTrackRefSeedFilter > _seedfilters
std::vector< unsigned int > _binseta
std::string encode() const
Definition: InputTag.cc:159
std::vector< unsigned int > _selections
std::vector< std::string > _labels
std::vector< TH2F * > _hfpixcluslenangle
std::vector< std::vector< TH2F * > > _hseedeta2D
std::vector< TH2F * > _hfpixclusleneta
std::vector< unsigned int > _binsmult
std::vector< edm::EDGetTokenT< std::map< unsigned int, int > > > _multiplicityMapTokens
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
std::vector< edm::EDGetTokenT< TrajectorySeedCollection > > _seedcollTokens
std::vector< unsigned int > _seedbins
ConsumesCollector consumesCollector()
Use a ConsumesCollector to gather consumes information from helper functions.
#define M_PI
std::vector< TH2F * > _hseedphieta
std::vector< TH1F * > _hpixelrhmult
std::vector< TH2F * > _hbpixcluslenangle
std::vector< std::vector< TH2F * > > _hseedmult2D
T * make(const Args &...args) const
make new ROOT object
Definition: TFileService.h:64
edm::ESGetToken< MagneticField, IdealMagneticFieldRecord > _magFieldToken
std::vector< TH2F * > _hbpixclusleneta
edm::ESGetToken< TransientTrackingRecHitBuilder, TransientRecHitRecord > _TTRHBuilderToken

◆ ~SeedMultiplicityAnalyzer()

SeedMultiplicityAnalyzer::~SeedMultiplicityAnalyzer ( )
override

Definition at line 280 of file SeedMultiplicityAnalyzer.cc.

280  {
281  // do anything here that needs to be done at desctruction time
282  // (e.g. close files, deallocate resources etc.)
283 }

Member Function Documentation

◆ analyze()

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

Implements edm::one::EDAnalyzerBase.

Definition at line 290 of file SeedMultiplicityAnalyzer.cc.

References _hbpixcluslenangle, _hbpixclusleneta, _hfpixcluslenangle, _hfpixclusleneta, _hpixelrhmult, _hseedeta, _hseedeta2D, _hseedmult, _hseedmult2D, _hseedphieta, _magFieldToken, _multiplicityMapTokens, _seedcollTokens, _seedfilters, _selections, _TTRHBuilderToken, SiPixelRecHit::cluster(), DetId::det(), PVValHelper::eta, ALCARECOTkAlBeamHalo_cff::filter, TrackingRecHit::geographicalId(), edm::EventSetup::getData(), mps_fire::i, iEvent, iseed, TrajectoryStateOnSurface::isValid(), TrajectoryStateOnSurface::localMomentum(), VarParsing::mult, phi, PixelSubdetector::PixelBarrel, PixelSubdetector::PixelEndcap, DetId::rawId(), rpcPointValidation_cfi::recHit, fileCollector::seed, DetachedQuadStep_cff::seeds, mathSSE::sqrt(), DetId::subdetId(), DetId::Tracker, trajectoryStateTransform::transientState(), trackerHitRTTI::vector, PV3DBase< T, PVType, FrameType >::x(), PV3DBase< T, PVType, FrameType >::y(), and PV3DBase< T, PVType, FrameType >::z().

290  {
291  using namespace edm;
292 
293  // compute cluster multiplicities
294 
295  std::vector<int> tmpmult(_multiplicityMapTokens.size(), -1);
296  for (unsigned int i = 0; i < _multiplicityMapTokens.size(); ++i) {
298  iEvent.getByToken(_multiplicityMapTokens[i], mults);
299 
300  // check if the selection exists
301 
302  std::map<unsigned int, int>::const_iterator mult = mults->find(_selections[i]);
303 
304  if (mult != mults->end()) {
305  tmpmult[i] = mult->second;
306  } else {
307  edm::LogWarning("DetSelectionNotFound") << " DetSelection " << _selections[i] << " not found";
308  }
309  }
310 
311  // preparation for loop on seeds
312 
313  // TrajectoryStateTransform tsTransform;
314  TSCBLBuilderNoMaterial tscblBuilder; // I could have used TSCBLBuilderWithPropagator
315 
316  const auto theMF = &iSetup.getData(_magFieldToken);
317  const auto& theTTRHBuilder = iSetup.getData(_TTRHBuilderToken);
318 
319  // I need:
320  // - beamspot bs POSTPONED
321 
322  std::vector<TH1F*>::iterator histomult = _hseedmult.begin();
323  std::vector<std::vector<TH2F*>>::iterator histomult2D = _hseedmult2D.begin();
324  std::vector<TH1F*>::iterator histoeta = _hseedeta.begin();
325  std::vector<TH2F*>::iterator histophieta = _hseedphieta.begin();
326  std::vector<std::vector<TH2F*>>::iterator histoeta2D = _hseedeta2D.begin();
327  std::vector<TH1F*>::iterator hpixelrhmult = _hpixelrhmult.begin();
328  std::vector<TH2F*>::iterator histobpixleneta = _hbpixclusleneta.begin();
329  std::vector<TH2F*>::iterator histofpixleneta = _hfpixclusleneta.begin();
330  std::vector<TH2F*>::iterator histobpixlenangle = _hbpixcluslenangle.begin();
331  std::vector<TH2F*>::iterator histofpixlenangle = _hfpixcluslenangle.begin();
332  std::vector<FromTrackRefSeedFilter>::iterator filter = _seedfilters.begin();
333 
334  // loop on seed collections
335 
336  for (std::vector<edm::EDGetTokenT<TrajectorySeedCollection>>::const_iterator coll = _seedcollTokens.begin();
337  coll != _seedcollTokens.end() && histomult != _hseedmult.end() && histomult2D != _hseedmult2D.end() &&
338  histoeta != _hseedeta.end() && histoeta2D != _hseedeta2D.end() && histophieta != _hseedphieta.end() &&
339  hpixelrhmult != _hpixelrhmult.end() && histobpixleneta != _hbpixclusleneta.end() &&
340  histofpixleneta != _hfpixclusleneta.end() && histobpixlenangle != _hbpixcluslenangle.end() &&
341  histofpixlenangle != _hfpixcluslenangle.end();
342  ++coll,
343  ++histomult,
344  ++histomult2D,
345  ++histoeta,
346  ++histophieta,
347  ++histoeta2D,
348  ++hpixelrhmult,
349  ++histobpixleneta,
350  ++histofpixleneta,
351  ++histobpixlenangle,
352  ++histofpixlenangle,
353  ++filter) {
354  filter->prepareEvent(iEvent);
355 
357  iEvent.getByToken(*coll, seeds);
358 
359  /*
360  (*histomult)->Fill(seeds->size());
361 
362  for(unsigned int i=0;i<_multiplicityMaps.size();++i) {
363  if(tmpmult[i]>=0) (*histomult2D)[i]->Fill(tmpmult[i],seeds->size());
364  }
365  */
366 
367  // loop on seeds
368 
369  unsigned int nseeds = 0;
370  unsigned int iseed = 0;
371  for (TrajectorySeedCollection::const_iterator seed = seeds->begin(); seed != seeds->end(); ++seed, ++iseed) {
372  if (filter->isSelected(iseed)) {
373  ++nseeds;
374 
375  TransientTrackingRecHit::RecHitPointer recHit = theTTRHBuilder.build(&*(seed->recHits().end() - 1));
377  trajectoryStateTransform::transientState(seed->startingState(), recHit->surface(), theMF);
378  // TrajectoryStateClosestToBeamLine tsAtClosestApproachSeed = tscblBuilder(*state.freeState(),bs); // here I need them BS
379 
380  double eta = state.globalMomentum().eta();
381  double phi = state.globalMomentum().phi();
382 
383  (*histoeta)->Fill(eta);
384  (*histophieta)->Fill(eta, phi);
385 
386  for (unsigned int i = 0; i < _multiplicityMapTokens.size(); ++i) {
387  if (tmpmult[i] >= 0)
388  (*histoeta2D)[i]->Fill(tmpmult[i], eta);
389  }
390 
391  int npixelrh = 0;
392  for (auto const& hit : seed->recHits()) {
393  const SiPixelRecHit* sphit = dynamic_cast<const SiPixelRecHit*>(&hit);
394  if (sphit) {
395  ++npixelrh;
396  // compute state on recHit surface
397  TransientTrackingRecHit::RecHitPointer ttrhit = theTTRHBuilder.build(&hit);
399  trajectoryStateTransform::transientState(seed->startingState(), ttrhit->surface(), theMF);
400 
401  if (sphit->geographicalId().det() == DetId::Tracker &&
403  (*histobpixleneta)->Fill(eta, sphit->cluster()->sizeY());
404  if (tsos.isValid()) {
405  // double normdx = sin(atan2(tsos.localMomentum().x(),tsos.localMomentum().z()));
406  double normdx = tsos.localMomentum().x() / sqrt(tsos.localMomentum().x() * tsos.localMomentum().x() +
407  tsos.localMomentum().z() * tsos.localMomentum().z());
408  (*histobpixlenangle)->Fill(normdx, sphit->cluster()->sizeY());
409  }
410  } else if (sphit->geographicalId().det() == DetId::Tracker &&
412  (*histofpixleneta)->Fill(eta, sphit->cluster()->sizeX());
413  if (tsos.isValid()) {
414  // double normdy = sin(atan2(tsos.localMomentum().y(),tsos.localMomentum().z()));
415  double normdy = tsos.localMomentum().y() / sqrt(tsos.localMomentum().y() * tsos.localMomentum().y() +
416  tsos.localMomentum().z() * tsos.localMomentum().z());
417  (*histofpixlenangle)->Fill(normdy, sphit->cluster()->sizeX());
418  }
419  } else {
420  edm::LogError("InconsistentSiPixelRecHit")
421  << "SiPixelRecHit with a non-pixel DetId " << sphit->geographicalId().rawId();
422  }
423  }
424  }
425  (*hpixelrhmult)->Fill(npixelrh);
426  }
427  }
428  (*histomult)->Fill(nseeds);
429 
430  for (unsigned int i = 0; i < _multiplicityMapTokens.size(); ++i) {
431  if (tmpmult[i] >= 0)
432  (*histomult2D)[i]->Fill(tmpmult[i], nseeds);
433  }
434  }
435 }
ClusterRef cluster() const
Definition: SiPixelRecHit.h:47
T const & getData(const ESGetToken< T, R > &iToken) const noexcept(false)
Definition: EventSetup.h:119
std::vector< FromTrackRefSeedFilter > _seedfilters
T z() const
Definition: PV3DBase.h:61
std::vector< unsigned int > _selections
std::vector< TH2F * > _hfpixcluslenangle
std::vector< std::vector< TH2F * > > _hseedeta2D
std::vector< TH2F * > _hfpixclusleneta
Log< level::Error, false > LogError
constexpr Detector det() const
get the detector field from this detid
Definition: DetId.h:46
std::vector< edm::EDGetTokenT< std::map< unsigned int, int > > > _multiplicityMapTokens
std::vector< edm::EDGetTokenT< TrajectorySeedCollection > > _seedcollTokens
T x() const
Definition: PV3DBase.h:59
T y() const
Definition: PV3DBase.h:60
int iEvent
Definition: GenABIO.cc:224
T sqrt(T t)
Definition: SSEVec.h:19
constexpr int subdetId() const
get the contents of the subdetector field (not cast into any detector&#39;s numbering enum) ...
Definition: DetId.h:48
std::shared_ptr< TrackingRecHit const > RecHitPointer
std::vector< TH2F * > _hseedphieta
std::vector< TH1F * > _hpixelrhmult
int iseed
Definition: AMPTWrapper.h:134
TrajectoryStateOnSurface transientState(const PTrajectoryStateOnDet &ts, const Surface *surface, const MagneticField *field)
DetId geographicalId() const
std::vector< TH2F * > _hbpixcluslenangle
constexpr uint32_t rawId() const
get the raw id
Definition: DetId.h:57
std::vector< std::vector< TH2F * > > _hseedmult2D
HLT enums.
edm::ESGetToken< MagneticField, IdealMagneticFieldRecord > _magFieldToken
Log< level::Warning, false > LogWarning
std::vector< TH2F * > _hbpixclusleneta
Our base class.
Definition: SiPixelRecHit.h:23
edm::ESGetToken< TransientTrackingRecHitBuilder, TransientRecHitRecord > _TTRHBuilderToken

Member Data Documentation

◆ _binseta

std::vector<unsigned int> SeedMultiplicityAnalyzer::_binseta
private

Definition at line 106 of file SeedMultiplicityAnalyzer.cc.

◆ _binsmult

std::vector<unsigned int> SeedMultiplicityAnalyzer::_binsmult
private

Definition at line 105 of file SeedMultiplicityAnalyzer.cc.

◆ _hbpixcluslenangle

std::vector<TH2F*> SeedMultiplicityAnalyzer::_hbpixcluslenangle
private

Definition at line 114 of file SeedMultiplicityAnalyzer.cc.

Referenced by analyze().

◆ _hbpixclusleneta

std::vector<TH2F*> SeedMultiplicityAnalyzer::_hbpixclusleneta
private

Definition at line 112 of file SeedMultiplicityAnalyzer.cc.

Referenced by analyze().

◆ _hfpixcluslenangle

std::vector<TH2F*> SeedMultiplicityAnalyzer::_hfpixcluslenangle
private

Definition at line 115 of file SeedMultiplicityAnalyzer.cc.

Referenced by analyze().

◆ _hfpixclusleneta

std::vector<TH2F*> SeedMultiplicityAnalyzer::_hfpixclusleneta
private

Definition at line 113 of file SeedMultiplicityAnalyzer.cc.

Referenced by analyze().

◆ _hpixelrhmult

std::vector<TH1F*> SeedMultiplicityAnalyzer::_hpixelrhmult
private

Definition at line 111 of file SeedMultiplicityAnalyzer.cc.

Referenced by analyze().

◆ _hseedeta

std::vector<TH1F*> SeedMultiplicityAnalyzer::_hseedeta
private

Definition at line 109 of file SeedMultiplicityAnalyzer.cc.

Referenced by analyze().

◆ _hseedeta2D

std::vector<std::vector<TH2F*> > SeedMultiplicityAnalyzer::_hseedeta2D
private

Definition at line 117 of file SeedMultiplicityAnalyzer.cc.

Referenced by analyze().

◆ _hseedmult

std::vector<TH1F*> SeedMultiplicityAnalyzer::_hseedmult
private

Definition at line 108 of file SeedMultiplicityAnalyzer.cc.

Referenced by analyze().

◆ _hseedmult2D

std::vector<std::vector<TH2F*> > SeedMultiplicityAnalyzer::_hseedmult2D
private

Definition at line 116 of file SeedMultiplicityAnalyzer.cc.

Referenced by analyze().

◆ _hseedphieta

std::vector<TH2F*> SeedMultiplicityAnalyzer::_hseedphieta
private

Definition at line 110 of file SeedMultiplicityAnalyzer.cc.

Referenced by analyze().

◆ _labels

std::vector<std::string> SeedMultiplicityAnalyzer::_labels
private

◆ _magFieldToken

edm::ESGetToken<MagneticField, IdealMagneticFieldRecord> SeedMultiplicityAnalyzer::_magFieldToken
private

Definition at line 96 of file SeedMultiplicityAnalyzer.cc.

Referenced by analyze().

◆ _maxs

std::vector<double> SeedMultiplicityAnalyzer::_maxs
private

Definition at line 107 of file SeedMultiplicityAnalyzer.cc.

◆ _multiplicityMapTokens

std::vector<edm::EDGetTokenT<std::map<unsigned int, int> > > SeedMultiplicityAnalyzer::_multiplicityMapTokens
private

Definition at line 102 of file SeedMultiplicityAnalyzer.cc.

Referenced by analyze().

◆ _seedbins

std::vector<unsigned int> SeedMultiplicityAnalyzer::_seedbins
private

Definition at line 99 of file SeedMultiplicityAnalyzer.cc.

◆ _seedcollTokens

std::vector<edm::EDGetTokenT<TrajectorySeedCollection> > SeedMultiplicityAnalyzer::_seedcollTokens
private

Definition at line 98 of file SeedMultiplicityAnalyzer.cc.

Referenced by analyze().

◆ _seedfilters

std::vector<FromTrackRefSeedFilter> SeedMultiplicityAnalyzer::_seedfilters
private

Definition at line 101 of file SeedMultiplicityAnalyzer.cc.

Referenced by analyze().

◆ _seedmax

std::vector<double> SeedMultiplicityAnalyzer::_seedmax
private

Definition at line 100 of file SeedMultiplicityAnalyzer.cc.

◆ _selections

std::vector<unsigned int> SeedMultiplicityAnalyzer::_selections
private

Definition at line 104 of file SeedMultiplicityAnalyzer.cc.

Referenced by analyze().

◆ _TTRHBuilderToken

edm::ESGetToken<TransientTrackingRecHitBuilder, TransientRecHitRecord> SeedMultiplicityAnalyzer::_TTRHBuilderToken
private

Definition at line 97 of file SeedMultiplicityAnalyzer.cc.

Referenced by analyze().