CMS 3D CMS Logo

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

#include <GEMCoPadProcessor.h>

Public Types

enum  { MAX_CoPad_BINS = 3 }
 

Public Member Functions

void clear ()
 
void declusterize (const GEMPadDigiClusterCollection *, GEMPadDigiCollection &) const
 
 GEMCoPadProcessor (unsigned region, unsigned station, unsigned chamber, const edm::ParameterSet &copad)
 
 GEMCoPadProcessor ()
 
const std::vector< GEMCoPadDigi > & readoutCoPads () const
 
std::vector< GEMCoPadDigirun (const GEMPadDigiCollection *)
 
std::vector< GEMCoPadDigirun (const GEMPadDigiClusterCollection *)
 

Private Attributes

std::vector< GEMCoPadDigigemCoPadV
 
unsigned int infoV
 
unsigned int maxDeltaBX_
 
unsigned int maxDeltaPad_
 
unsigned int maxDeltaRoll_
 
const int theChamber
 
const int theRegion
 
const int theStation
 

Detailed Description

Author
Sven Dildick (TAMU)

Definition at line 17 of file GEMCoPadProcessor.h.

Member Enumeration Documentation

anonymous enum

Maximum number of time bins.

Enumerator
MAX_CoPad_BINS 

Definition at line 37 of file GEMCoPadProcessor.h.

Constructor & Destructor Documentation

GEMCoPadProcessor::GEMCoPadProcessor ( unsigned  region,
unsigned  station,
unsigned  chamber,
const edm::ParameterSet copad 
)

Normal constructor.

Definition at line 11 of file GEMCoPadProcessor.cc.

References edm::ParameterSet::getParameter(), infoV, maxDeltaBX_, maxDeltaPad_, and maxDeltaRoll_.

13  // Verbosity level, set to 0 (no print) by default.
14  infoV = copad.getParameter<unsigned int>("verbosity");
15  maxDeltaPad_ = copad.getParameter<unsigned int>("maxDeltaPad");
16  maxDeltaRoll_ = copad.getParameter<unsigned int>("maxDeltaRoll");
17  maxDeltaBX_ = copad.getParameter<unsigned int>("maxDeltaBX");
18 }
T getParameter(std::string const &) const
unsigned int maxDeltaBX_
unsigned int maxDeltaPad_
unsigned int maxDeltaRoll_
GEMCoPadProcessor::GEMCoPadProcessor ( )

Default constructor. Used for testing.

Definition at line 20 of file GEMCoPadProcessor.cc.

References infoV, maxDeltaBX_, maxDeltaPad_, and maxDeltaRoll_.

20  : theRegion(1), theStation(1), theChamber(1) {
21  infoV = 0;
22  maxDeltaPad_ = 0;
23  maxDeltaRoll_ = 0;
24  maxDeltaBX_ = 0;
25 }
unsigned int maxDeltaBX_
unsigned int maxDeltaPad_
unsigned int maxDeltaRoll_

Member Function Documentation

void GEMCoPadProcessor::clear ( void  )

Clear copad vector

Definition at line 27 of file GEMCoPadProcessor.cc.

References gemCoPadV.

27 { gemCoPadV.clear(); }
std::vector< GEMCoPadDigi > gemCoPadV
void GEMCoPadProcessor::declusterize ( const GEMPadDigiClusterCollection in_clusters,
GEMPadDigiCollection out_pads 
) const

Definition at line 81 of file GEMCoPadProcessor.cc.

References AlCaHLTBitMon_ParallelJobs::p, and FastTimerService_cff::range.

Referenced by run().

82  {
83  for (auto detUnitIt = in_clusters->begin(); detUnitIt != in_clusters->end(); ++detUnitIt) {
84  const GEMDetId& id = (*detUnitIt).first;
85  const auto& range = (*detUnitIt).second;
86  for (auto digiIt = range.first; digiIt != range.second; ++digiIt) {
87  for (const auto& p : digiIt->pads()) {
88  out_pads.insertDigi(id, GEMPadDigi(p, digiIt->bx()));
89  }
90  }
91  }
92 }
const std::vector< GEMCoPadDigi > & GEMCoPadProcessor::readoutCoPads ( ) const

Returns vector of CoPads in the read-out time window, if any.

Definition at line 79 of file GEMCoPadProcessor.cc.

References gemCoPadV.

79 { return gemCoPadV; }
std::vector< GEMCoPadDigi > gemCoPadV
std::vector< GEMCoPadDigi > GEMCoPadProcessor::run ( const GEMPadDigiCollection in_pads)

Runs the CoPad processor code. Called in normal running – gets info from a collection of pad digis.

Definition at line 29 of file GEMCoPadProcessor.cc.

References funct::abs(), relativeConstraints::chamber, gemCoPadV, maxDeltaBX_, maxDeltaPad_, maxDeltaRoll_, or, AlCaHLTBitMon_ParallelJobs::p, HLT_2018_cff::region, relativeConstraints::ring, relativeConstraints::station, theChamber, theRegion, and theStation.

Referenced by run().

29  {
30  // Build coincidences
31  for (auto det_range = in_pads->begin(); det_range != in_pads->end(); ++det_range) {
32  const GEMDetId& id = (*det_range).first;
33 
34  // same chamber (no restriction on the roll number)
35  if (id.region() != theRegion or id.station() != theStation or id.chamber() != theChamber)
36  continue;
37 
38  // all coincidences detIDs will have layer=1
39  if (id.layer() != 1)
40  continue;
41 
42  // find all corresponding ids with layer 2 and same roll that differs at most maxDeltaRoll_
43  for (unsigned int roll = id.roll() - maxDeltaRoll_; roll <= id.roll() + maxDeltaRoll_; ++roll) {
44  GEMDetId co_id(id.region(), id.ring(), id.station(), 2, id.chamber(), roll);
45 
46  auto co_pads_range = in_pads->get(co_id);
47 
48  // empty range = no possible coincidence pads
49  if (co_pads_range.first == co_pads_range.second)
50  continue;
51 
52  // now let's correlate the pads in two layers of this partition
53  const auto& pads_range = (*det_range).second;
54  for (auto p = pads_range.first; p != pads_range.second; ++p) {
55  for (auto co_p = co_pads_range.first; co_p != co_pads_range.second; ++co_p) {
56  // check the match in pad
57  if ((unsigned)std::abs(p->pad() - co_p->pad()) > maxDeltaPad_)
58  continue;
59 
60  // check the match in BX
61  if ((unsigned)std::abs(p->bx() - co_p->bx()) > maxDeltaBX_)
62  continue;
63 
64  // make a new coincidence pad digi
65  gemCoPadV.push_back(GEMCoPadDigi(id.roll(), *p, *co_p));
66  }
67  }
68  }
69  }
70  return gemCoPadV;
71 }
std::vector< GEMCoPadDigi > gemCoPadV
The Signals That Services Can Subscribe To This is based on ActivityRegistry and is current per Services can connect to the signals distributed by the ActivityRegistry in order to monitor the activity of the application Each possible callback has some defined which we here list in angle e< void, edm::EventID const &, edm::Timestamp const & > We also list in braces which AR_WATCH_USING_METHOD_ is used for those or
Definition: Activities.doc:12
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
unsigned int maxDeltaBX_
unsigned int maxDeltaPad_
unsigned int maxDeltaRoll_
std::vector< GEMCoPadDigi > GEMCoPadProcessor::run ( const GEMPadDigiClusterCollection in_clusters)

Runs the CoPad processor code. Called in normal running – gets info from a collection of pad digi clusters.

Definition at line 73 of file GEMCoPadProcessor.cc.

References declusterize(), and run().

73  {
74  std::unique_ptr<GEMPadDigiCollection> out_pads(new GEMPadDigiCollection());
75  declusterize(in_clusters, *out_pads);
76  return run(out_pads.get());
77 }
std::vector< GEMCoPadDigi > run(const GEMPadDigiCollection *)
void declusterize(const GEMPadDigiClusterCollection *, GEMPadDigiCollection &) const
MuonDigiCollection< GEMDetId, GEMPadDigi > GEMPadDigiCollection

Member Data Documentation

std::vector<GEMCoPadDigi> GEMCoPadProcessor::gemCoPadV
private

Definition at line 61 of file GEMCoPadProcessor.h.

Referenced by clear(), readoutCoPads(), and run().

unsigned int GEMCoPadProcessor::infoV
private

Verbosity level: 0: no print (default). 1: print only CoPads found. 2: info at every step of the algorithm. 3: add special-purpose prints.

Definition at line 55 of file GEMCoPadProcessor.h.

Referenced by GEMCoPadProcessor().

unsigned int GEMCoPadProcessor::maxDeltaBX_
private

Definition at line 57 of file GEMCoPadProcessor.h.

Referenced by GEMCoPadProcessor(), and run().

unsigned int GEMCoPadProcessor::maxDeltaPad_
private

Definition at line 56 of file GEMCoPadProcessor.h.

Referenced by GEMCoPadProcessor(), and run().

unsigned int GEMCoPadProcessor::maxDeltaRoll_
private

Definition at line 58 of file GEMCoPadProcessor.h.

Referenced by GEMCoPadProcessor(), and run().

const int GEMCoPadProcessor::theChamber
private

Definition at line 49 of file GEMCoPadProcessor.h.

Referenced by run().

const int GEMCoPadProcessor::theRegion
private

Chamber id (trigger-type labels).

Definition at line 47 of file GEMCoPadProcessor.h.

Referenced by run().

const int GEMCoPadProcessor::theStation
private

Definition at line 48 of file GEMCoPadProcessor.h.

Referenced by run().