CMS 3D CMS Logo

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

#include <RPCGeometryServTest.h>

Inheritance diagram for RPCGeometryServTest:
edm::EDAnalyzer 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::EDAnalyzer
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
 EDAnalyzer ()
 
SerialTaskQueueglobalLuminosityBlocksQueue ()
 
SerialTaskQueueglobalRunsQueue ()
 
ModuleDescription const & moduleDescription () const
 
std::string workerType () const
 
 ~EDAnalyzer () 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 &&)=default
 
 EDConsumerBase (EDConsumerBase const &)=delete
 
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
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
bool registeredToConsume (ProductResolverIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
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_
 

Additional Inherited Members

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

Detailed Description

Author
M. Maggi - INFN Bari

Definition at line 29 of file RPCGeometryServTest.h.

Constructor & Destructor Documentation

◆ RPCGeometryServTest()

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

Definition at line 33 of file RPCGeometryServTest.cc.

34  : dashedLineWidth_(104), dashedLine_(std::string(dashedLineWidth_, '-')), myName_("RPCGeometryServTest") {
35  std::cout << "======================== Opening output file" << std::endl;
36 }

References gather_cfg::cout.

◆ ~RPCGeometryServTest()

RPCGeometryServTest::~RPCGeometryServTest ( )
override

Definition at line 38 of file RPCGeometryServTest.cc.

38 {}

Member Function Documentation

◆ analyze()

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

Implements edm::EDAnalyzer.

Definition at line 40 of file RPCGeometryServTest.cc.

40  {
42  iSetup.get<MuonGeometryRecord>().get(pDD);
43 
44  std::cout << myName() << ": Analyzer..." << std::endl;
45  std::cout << "start " << dashedLine_ << std::endl;
46 
47  std::cout << " Geometry node for RPCGeom is " << &(*pDD) << std::endl;
48  cout << " I have " << pDD->detTypes().size() << " detTypes" << endl;
49  cout << " I have " << pDD->detUnits().size() << " detUnits" << endl;
50  cout << " I have " << pDD->dets().size() << " dets" << endl;
51  cout << " I have " << pDD->rolls().size() << " rolls" << endl;
52  cout << " I have " << pDD->chambers().size() << " chambers" << endl;
53 
54  std::cout << myName() << ": Begin iteration over geometry..." << std::endl;
55  std::cout << "iter " << dashedLine_ << std::endl;
56 
57  int iRPCCHcount = 0;
58  LocalPoint a(0., 0., 0.);
59  for (TrackingGeometry::DetContainer::const_iterator it = pDD->dets().begin(); it != pDD->dets().end(); it++) {
60  //----------------------- RPCCHAMBER TEST ---------------------------
61 
62  if (dynamic_cast<const RPCChamber*>(*it) != nullptr) {
63  ++iRPCCHcount;
64  const RPCChamber* ch = dynamic_cast<const RPCChamber*>(*it);
65 
66  std::vector<const RPCRoll*> rollsRaf = (ch->rolls());
67  for (std::vector<const RPCRoll*>::iterator r = rollsRaf.begin(); r != rollsRaf.end(); ++r) {
68  std::cout << dashedLine_ << " NEW ROLL" << std::endl;
69  std::cout << "Region = " << (*r)->id().region() << " Ring = " << (*r)->id().ring()
70  << " Station = " << (*r)->id().station() << " Sector = " << (*r)->id().sector()
71  << " Layer = " << (*r)->id().layer() << " Subsector = " << (*r)->id().subsector()
72  << " Roll = " << (*r)->id().roll() << std::endl;
73  RPCGeomServ s((*r)->id());
74  GlobalPoint g = (*r)->toGlobal(a);
75  std::cout << s.name() << " eta partition " << s.eta_partition() << " nroll=" << ch->nrolls() << " z=" << g.z()
76  << " phi=" << g.phi() << " R=" << g.perp() << std::endl;
77 
78  if ((*r)->id().region() == 0) {
79  if (barzranges.find(s.eta_partition()) != barzranges.end()) {
80  std::pair<double, double> cic = barzranges.find(s.eta_partition())->second;
81  double cmin = cic.first;
82  double cmax = cic.second;
83  if (g.z() < cmin)
84  cmin = g.z();
85  if (g.z() > cmax)
86  cmax = g.z();
87  std::pair<double, double> cic2(cmin, cmax);
88  barzranges[s.eta_partition()] = cic2;
89  } else {
90  std::pair<double, double> cic(g.z(), g.z());
91  barzranges[s.eta_partition()] = cic;
92  }
93  } else if ((*r)->id().region() == +1) {
94  if (forRranges.find(s.eta_partition()) != forRranges.end()) {
95  std::pair<double, double> cic = forRranges.find(s.eta_partition())->second;
96  double cmin = cic.first;
97  double cmax = cic.second;
98  if (g.perp() < cmin)
99  cmin = g.perp();
100  if (g.perp() > cmax)
101  cmax = g.perp();
102  std::pair<double, double> cic2(cmin, cmax);
103  forRranges[s.eta_partition()] = cic2;
104  } else {
105  std::pair<double, double> cic(g.perp(), g.perp());
106  forRranges[s.eta_partition()] = cic;
107  }
108  } else if ((*r)->id().region() == -1) {
109  if (bacRranges.find(s.eta_partition()) != bacRranges.end()) {
110  std::pair<double, double> cic = bacRranges.find(s.eta_partition())->second;
111  double cmin = cic.first;
112  double cmax = cic.second;
113  if (g.perp() < cmin)
114  cmin = g.perp();
115  if (g.perp() > cmax)
116  cmax = g.perp();
117  std::pair<double, double> cic2(cmin, cmax);
118  bacRranges[s.eta_partition()] = cic2;
119  } else {
120  std::pair<double, double> cic(g.perp(), g.perp());
121  bacRranges[s.eta_partition()] = cic;
122  }
123  }
124  }
125  }
126  }
127 
128  std::cout << std::endl;
129  std::map<int, std::pair<double, double> >::iterator ieta;
130 
131  for (ieta = bacRranges.begin(); ieta != bacRranges.end(); ieta++) {
132  std::cout << " Eta " << ieta->first << " Radii = ( " << ieta->second.first << ", " << ieta->second.second << ")"
133  << std::endl;
134  }
135 
136  for (ieta = barzranges.begin(); ieta != barzranges.end(); ieta++) {
137  std::cout << " Eta " << ieta->first << " Z = ( " << ieta->second.first << ", " << ieta->second.second << ")"
138  << std::endl;
139  }
140 
141  for (ieta = forRranges.begin(); ieta != forRranges.end(); ieta++) {
142  std::cout << " Eta " << ieta->first << " Radii = ( " << ieta->second.first << ", " << ieta->second.second << ")"
143  << std::endl;
144  }
145 
146  std::cout << dashedLine_ << " end" << std::endl;
147 }

References a, bacRranges, barzranges, RPCGeometry::chambers(), gather_cfg::cout, dashedLine_, RPCGeometry::dets(), RPCGeometry::detTypes(), RPCGeometry::detUnits(), forRranges, g, edm::EventSetup::get(), get, LEDCalibrationChannels::ieta, myName(), RPCChamber::nrolls(), alignCSCRings::r, RPCChamber::rolls(), RPCGeometry::rolls(), alignCSCRings::s, and edm::second().

◆ myName()

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

Definition at line 37 of file RPCGeometryServTest.h.

37 { return myName_; }

References myName_.

Referenced by analyze().

Member Data Documentation

◆ bacRranges

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

Definition at line 45 of file RPCGeometryServTest.h.

Referenced by analyze().

◆ barzranges

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

Definition at line 43 of file RPCGeometryServTest.h.

Referenced by analyze().

◆ dashedLine_

const std::string RPCGeometryServTest::dashedLine_
private

Definition at line 41 of file RPCGeometryServTest.h.

Referenced by analyze().

◆ dashedLineWidth_

const int RPCGeometryServTest::dashedLineWidth_
private

Definition at line 40 of file RPCGeometryServTest.h.

◆ forRranges

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

Definition at line 44 of file RPCGeometryServTest.h.

Referenced by analyze().

◆ myName_

const std::string RPCGeometryServTest::myName_
private

Definition at line 42 of file RPCGeometryServTest.h.

Referenced by myName().

RPCChamber::nrolls
int nrolls() const
Retunr numbers of rolls.
Definition: RPCChamber.cc:42
RPCGeomServ
Definition: RPCGeomServ.h:8
RPCGeometryServTest::bacRranges
std::map< int, std::pair< double, double > > bacRranges
Definition: RPCGeometryServTest.h:45
gather_cfg.cout
cout
Definition: gather_cfg.py:144
RPCGeometry::detTypes
const DetTypeContainer & detTypes() const override
Return a vector of all det types.
Definition: RPCGeometry.cc:20
edm::second
U second(std::pair< T, U > const &p)
Definition: ParameterSet.cc:222
RPCGeometry::detUnits
const DetContainer & detUnits() const override
Returm a vector of all GeomDet.
Definition: RPCGeometry.cc:22
RPCChamber::rolls
const std::vector< const RPCRoll * > & rolls() const
Return the Rolls.
Definition: RPCChamber.cc:40
RPCChamber
Definition: RPCChamber.h:19
RPCGeometry::chambers
const std::vector< const RPCChamber * > & chambers() const
Return a vector of all RPC chambers.
Definition: RPCGeometry.cc:42
alignCSCRings.s
s
Definition: alignCSCRings.py:92
edm::EventSetup::get
T get() const
Definition: EventSetup.h:87
RPCGeometryServTest::barzranges
std::map< int, std::pair< double, double > > barzranges
Definition: RPCGeometryServTest.h:43
edm::ESHandle< RPCGeometry >
Point3DBase< float, LocalTag >
RPCGeometry::dets
const DetContainer & dets() const override
Returm a vector of all GeomDet (including all GeomDetUnits)
Definition: RPCGeometry.cc:24
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
RPCGeometryServTest::dashedLine_
const std::string dashedLine_
Definition: RPCGeometryServTest.h:41
LEDCalibrationChannels.ieta
ieta
Definition: LEDCalibrationChannels.py:63
a
double a
Definition: hdecay.h:119
get
#define get
alignCSCRings.r
r
Definition: alignCSCRings.py:93
RPCGeometryServTest::myName_
const std::string myName_
Definition: RPCGeometryServTest.h:42
RPCGeometryServTest::dashedLineWidth_
const int dashedLineWidth_
Definition: RPCGeometryServTest.h:40
RPCGeometry::rolls
const std::vector< const RPCRoll * > & rolls() const
Return a vector of all RPC rolls.
Definition: RPCGeometry.cc:44
MuonGeometryRecord
Definition: MuonGeometryRecord.h:34
RPCGeometryServTest::forRranges
std::map< int, std::pair< double, double > > forRranges
Definition: RPCGeometryServTest.h:44
g
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
RPCGeometryServTest::myName
const std::string & myName()
Definition: RPCGeometryServTest.h:37