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 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
 
ESProxyIndex const * esGetTokenIndices (edm::Transition iTrans) const
 
std::vector< ESProxyIndex > 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
 
bool registeredToConsumeMany (TypeID const &, 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::ESRecordsToProxyIndices 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 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<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(), LEDCalibrationChannels::ieta, 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  int iRPCCHcount = 0;
47  LocalPoint a(0., 0., 0.);
48  for (TrackingGeometry::DetContainer::const_iterator it = pDD->dets().begin(); it != pDD->dets().end(); it++) {
49  //----------------------- RPCCHAMBER TEST ---------------------------
50 
51  if (dynamic_cast<const RPCChamber*>(*it) != nullptr) {
52  ++iRPCCHcount;
53  const RPCChamber* ch = dynamic_cast<const RPCChamber*>(*it);
54 
55  std::vector<const RPCRoll*> rollsRaf = (ch->rolls());
56  for (std::vector<const RPCRoll*>::iterator r = rollsRaf.begin(); r != rollsRaf.end(); ++r) {
57  std::cout << dashedLine_ << " NEW ROLL" << std::endl;
58  std::cout << "Region = " << (*r)->id().region() << " Ring = " << (*r)->id().ring()
59  << " Station = " << (*r)->id().station() << " Sector = " << (*r)->id().sector()
60  << " Layer = " << (*r)->id().layer() << " Subsector = " << (*r)->id().subsector()
61  << " Roll = " << (*r)->id().roll() << std::endl;
62  RPCGeomServ s((*r)->id());
63  GlobalPoint g = (*r)->toGlobal(a);
64  std::cout << s.name() << " eta partition " << s.eta_partition() << " nroll=" << ch->nrolls() << " z=" << g.z()
65  << " phi=" << g.phi() << " R=" << g.perp() << std::endl;
66 
67  if ((*r)->id().region() == 0) {
68  if (barzranges.find(s.eta_partition()) != barzranges.end()) {
69  std::pair<double, double> cic = barzranges.find(s.eta_partition())->second;
70  double cmin = cic.first;
71  double cmax = cic.second;
72  if (g.z() < cmin)
73  cmin = g.z();
74  if (g.z() > cmax)
75  cmax = g.z();
76  std::pair<double, double> cic2(cmin, cmax);
77  barzranges[s.eta_partition()] = cic2;
78  } else {
79  std::pair<double, double> cic(g.z(), g.z());
80  barzranges[s.eta_partition()] = cic;
81  }
82  } else if ((*r)->id().region() == +1) {
83  if (forRranges.find(s.eta_partition()) != forRranges.end()) {
84  std::pair<double, double> cic = forRranges.find(s.eta_partition())->second;
85  double cmin = cic.first;
86  double cmax = cic.second;
87  if (g.perp() < cmin)
88  cmin = g.perp();
89  if (g.perp() > cmax)
90  cmax = g.perp();
91  std::pair<double, double> cic2(cmin, cmax);
92  forRranges[s.eta_partition()] = cic2;
93  } else {
94  std::pair<double, double> cic(g.perp(), g.perp());
95  forRranges[s.eta_partition()] = cic;
96  }
97  } else if ((*r)->id().region() == -1) {
98  if (bacRranges.find(s.eta_partition()) != bacRranges.end()) {
99  std::pair<double, double> cic = bacRranges.find(s.eta_partition())->second;
100  double cmin = cic.first;
101  double cmax = cic.second;
102  if (g.perp() < cmin)
103  cmin = g.perp();
104  if (g.perp() > cmax)
105  cmax = g.perp();
106  std::pair<double, double> cic2(cmin, cmax);
107  bacRranges[s.eta_partition()] = cic2;
108  } else {
109  std::pair<double, double> cic(g.perp(), g.perp());
110  bacRranges[s.eta_partition()] = cic;
111  }
112  }
113  }
114  }
115  }
116 
117  std::cout << std::endl;
118  std::map<int, std::pair<double, double> >::iterator ieta;
119 
120  for (ieta = bacRranges.begin(); ieta != bacRranges.end(); ieta++) {
121  std::cout << " Eta " << ieta->first << " Radii = ( " << ieta->second.first << ", " << ieta->second.second << ")"
122  << std::endl;
123  }
124 
125  for (ieta = barzranges.begin(); ieta != barzranges.end(); ieta++) {
126  std::cout << " Eta " << ieta->first << " Z = ( " << ieta->second.first << ", " << ieta->second.second << ")"
127  << std::endl;
128  }
129 
130  for (ieta = forRranges.begin(); ieta != forRranges.end(); ieta++) {
131  std::cout << " Eta " << ieta->first << " Radii = ( " << ieta->second.first << ", " << ieta->second.second << ")"
132  << std::endl;
133  }
134 
135  std::cout << dashedLine_ << " end" << std::endl;
136 }
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:151
std::map< int, std::pair< double, double > > forRranges
double a
Definition: hdecay.h:119
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().