CMS 3D CMS Logo

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

#include <RPCGeometryServTest.h>

Inheritance diagram for RPCGeometryServTest:
edm::one::EDAnalyzer<> edm::one::EDAnalyzerBase edm::EDConsumerBase

Public Member Functions

void analyze (const edm::Event &, const edm::EventSetup &) override
 
const std::string & myName ()
 
 RPCGeometryServTest (const edm::ParameterSet &pset)
 
 ~RPCGeometryServTest () override
 
- Public Member Functions inherited from edm::one::EDAnalyzer<>
 EDAnalyzer ()=default
 
 EDAnalyzer (const EDAnalyzer &)=delete
 
SerialTaskQueueglobalLuminosityBlocksQueue () final
 
SerialTaskQueueglobalRunsQueue () final
 
const EDAnalyzeroperator= (const EDAnalyzer &)=delete
 
bool wantsGlobalLuminosityBlocks () const noexcept final
 
bool wantsGlobalRuns () const noexcept final
 
bool wantsInputProcessBlocks () const noexcept final
 
bool wantsProcessBlocks () const noexcept 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 noexcept
 
bool wantsStreamRuns () const noexcept
 
 ~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 Attributes

std::map< int, std::pair< double, double > > bacRranges
 
std::map< int, std::pair< double, double > > barzranges
 
const std::string dashedLine_
 
const int dashedLineWidth_
 
std::map< int, std::pair< double, double > > forRranges
 
const std::string myName_
 
edm::ESGetToken< RPCGeometry, MuonGeometryRecordrpcGeomToken_
 

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

Definition at line 16 of file RPCGeometryServTest.h.

Constructor & Destructor Documentation

◆ RPCGeometryServTest()

RPCGeometryServTest::RPCGeometryServTest ( const edm::ParameterSet pset)

Definition at line 22 of file RPCGeometryServTest.cc.

References gather_cfg::cout, edm::EDConsumerBase::esConsumes(), and rpcGeomToken_.

23  : dashedLineWidth_(104), dashedLine_(std::string(dashedLineWidth_, '-')), myName_("RPCGeometryServTest") {
24  std::cout << "======================== Opening output file" << std::endl;
26 }
edm::ESGetToken< RPCGeometry, MuonGeometryRecord > rpcGeomToken_
const std::string myName_
const std::string dashedLine_

◆ ~RPCGeometryServTest()

RPCGeometryServTest::~RPCGeometryServTest ( )
override

Definition at line 28 of file RPCGeometryServTest.cc.

28 {}

Member Function Documentation

◆ analyze()

void RPCGeometryServTest::analyze ( const edm::Event iEvent,
const edm::EventSetup iSetup 
)
overridevirtual

Implements edm::one::EDAnalyzerBase.

Definition at line 30 of file RPCGeometryServTest.cc.

References a, bacRranges, barzranges, gather_cfg::cout, dashedLine_, forRranges, g, edm::EventSetup::getHandle(), hcalRecHitTable_cff::ieta, ALPAKA_ACCELERATOR_NAMESPACE::vertexFinder::it, myName(), RPCChamber::nrolls(), alignCSCRings::r, RPCChamber::rolls(), rpcGeomToken_, alignCSCRings::s, and edm::second().

30  {
31  const auto& pDD = iSetup.getHandle(rpcGeomToken_);
32 
33  std::cout << myName() << ": Analyzer..." << std::endl;
34  std::cout << "start " << dashedLine_ << std::endl;
35 
36  std::cout << " Geometry node for RPCGeom is " << &(*pDD) << std::endl;
37  cout << " I have " << pDD->detTypes().size() << " detTypes" << endl;
38  cout << " I have " << pDD->detUnits().size() << " detUnits" << endl;
39  cout << " I have " << pDD->dets().size() << " dets" << endl;
40  cout << " I have " << pDD->rolls().size() << " rolls" << endl;
41  cout << " I have " << pDD->chambers().size() << " chambers" << endl;
42 
43  std::cout << myName() << ": Begin iteration over geometry..." << std::endl;
44  std::cout << "iter " << dashedLine_ << std::endl;
45 
46  LocalPoint a(0., 0., 0.);
47  for (TrackingGeometry::DetContainer::const_iterator it = pDD->dets().begin(); it != pDD->dets().end(); it++) {
48  //----------------------- RPCCHAMBER TEST ---------------------------
49 
50  if (dynamic_cast<const RPCChamber*>(*it) != nullptr) {
51  const RPCChamber* ch = dynamic_cast<const RPCChamber*>(*it);
52 
53  std::vector<const RPCRoll*> rollsRaf = (ch->rolls());
54  for (std::vector<const RPCRoll*>::iterator r = rollsRaf.begin(); r != rollsRaf.end(); ++r) {
55  std::cout << dashedLine_ << " NEW ROLL" << std::endl;
56  std::cout << "Region = " << (*r)->id().region() << " Ring = " << (*r)->id().ring()
57  << " Station = " << (*r)->id().station() << " Sector = " << (*r)->id().sector()
58  << " Layer = " << (*r)->id().layer() << " Subsector = " << (*r)->id().subsector()
59  << " Roll = " << (*r)->id().roll() << std::endl;
60  RPCGeomServ s((*r)->id());
61  GlobalPoint g = (*r)->toGlobal(a);
62  std::cout << s.name() << " eta partition " << s.eta_partition() << " nroll=" << ch->nrolls() << " z=" << g.z()
63  << " phi=" << g.phi() << " R=" << g.perp() << std::endl;
64 
65  if ((*r)->id().region() == 0) {
66  if (barzranges.find(s.eta_partition()) != barzranges.end()) {
67  std::pair<double, double> cic = barzranges.find(s.eta_partition())->second;
68  double cmin = cic.first;
69  double cmax = cic.second;
70  if (g.z() < cmin)
71  cmin = g.z();
72  if (g.z() > cmax)
73  cmax = g.z();
74  std::pair<double, double> cic2(cmin, cmax);
75  barzranges[s.eta_partition()] = cic2;
76  } else {
77  std::pair<double, double> cic(g.z(), g.z());
78  barzranges[s.eta_partition()] = cic;
79  }
80  } else if ((*r)->id().region() == +1) {
81  if (forRranges.find(s.eta_partition()) != forRranges.end()) {
82  std::pair<double, double> cic = forRranges.find(s.eta_partition())->second;
83  double cmin = cic.first;
84  double cmax = cic.second;
85  if (g.perp() < cmin)
86  cmin = g.perp();
87  if (g.perp() > cmax)
88  cmax = g.perp();
89  std::pair<double, double> cic2(cmin, cmax);
90  forRranges[s.eta_partition()] = cic2;
91  } else {
92  std::pair<double, double> cic(g.perp(), g.perp());
93  forRranges[s.eta_partition()] = cic;
94  }
95  } else if ((*r)->id().region() == -1) {
96  if (bacRranges.find(s.eta_partition()) != bacRranges.end()) {
97  std::pair<double, double> cic = bacRranges.find(s.eta_partition())->second;
98  double cmin = cic.first;
99  double cmax = cic.second;
100  if (g.perp() < cmin)
101  cmin = g.perp();
102  if (g.perp() > cmax)
103  cmax = g.perp();
104  std::pair<double, double> cic2(cmin, cmax);
105  bacRranges[s.eta_partition()] = cic2;
106  } else {
107  std::pair<double, double> cic(g.perp(), g.perp());
108  bacRranges[s.eta_partition()] = cic;
109  }
110  }
111  }
112  }
113  }
114 
115  std::cout << std::endl;
116  std::map<int, std::pair<double, double> >::iterator ieta;
117 
118  for (ieta = bacRranges.begin(); ieta != bacRranges.end(); ieta++) {
119  std::cout << " Eta " << ieta->first << " Radii = ( " << ieta->second.first << ", " << ieta->second.second << ")"
120  << std::endl;
121  }
122 
123  for (ieta = barzranges.begin(); ieta != barzranges.end(); ieta++) {
124  std::cout << " Eta " << ieta->first << " Z = ( " << ieta->second.first << ", " << ieta->second.second << ")"
125  << std::endl;
126  }
127 
128  for (ieta = forRranges.begin(); ieta != forRranges.end(); ieta++) {
129  std::cout << " Eta " << ieta->first << " Radii = ( " << ieta->second.first << ", " << ieta->second.second << ")"
130  << std::endl;
131  }
132 
133  std::cout << dashedLine_ << " end" << std::endl;
134 }
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 g
Definition: Activities.doc:4
int nrolls() const
Retunr numbers of rolls.
Definition: RPCChamber.cc:42
U second(std::pair< T, U > const &p)
std::map< int, std::pair< double, double > > barzranges
edm::ESGetToken< RPCGeometry, MuonGeometryRecord > rpcGeomToken_
ESHandle< T > getHandle(const ESGetToken< T, R > &iToken) const
Definition: EventSetup.h:130
std::map< int, std::pair< double, double > > forRranges
double a
Definition: hdecay.h:121
const std::string & myName()
const std::vector< const RPCRoll * > & rolls() const
Return the Rolls.
Definition: RPCChamber.cc:40
const std::string dashedLine_
std::map< int, std::pair< double, double > > bacRranges

◆ myName()

const std::string& RPCGeometryServTest::myName ( void  )
inline

Definition at line 24 of file RPCGeometryServTest.h.

References myName_.

Referenced by analyze().

24 { return myName_; }
const std::string myName_

Member Data Documentation

◆ bacRranges

std::map<int, std::pair<double, double> > RPCGeometryServTest::bacRranges
private

Definition at line 32 of file RPCGeometryServTest.h.

Referenced by analyze().

◆ barzranges

std::map<int, std::pair<double, double> > RPCGeometryServTest::barzranges
private

Definition at line 30 of file RPCGeometryServTest.h.

Referenced by analyze().

◆ dashedLine_

const std::string RPCGeometryServTest::dashedLine_
private

Definition at line 28 of file RPCGeometryServTest.h.

Referenced by analyze().

◆ dashedLineWidth_

const int RPCGeometryServTest::dashedLineWidth_
private

Definition at line 27 of file RPCGeometryServTest.h.

◆ forRranges

std::map<int, std::pair<double, double> > RPCGeometryServTest::forRranges
private

Definition at line 31 of file RPCGeometryServTest.h.

Referenced by analyze().

◆ myName_

const std::string RPCGeometryServTest::myName_
private

Definition at line 29 of file RPCGeometryServTest.h.

Referenced by myName().

◆ rpcGeomToken_

edm::ESGetToken<RPCGeometry, MuonGeometryRecord> RPCGeometryServTest::rpcGeomToken_
private

Definition at line 33 of file RPCGeometryServTest.h.

Referenced by analyze(), and RPCGeometryServTest().