CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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

virtual void analyze (const edm::Event &, const edm::EventSetup &)
 
const std::string & myName ()
 
 RPCGeometryServTest (const edm::ParameterSet &pset)
 
 ~RPCGeometryServTest ()
 
- Public Member Functions inherited from edm::EDAnalyzer
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
 EDAnalyzer ()
 
ModuleDescription const & moduleDescription () const
 
std::string workerType () const
 
virtual ~EDAnalyzer ()
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
 EDConsumerBase ()
 
ProductHolderIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
std::vector
< ProductHolderIndexAndSkipBit >
const & 
itemsToGetFromEvent () const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesDependentUpon (const std::string &iProcessName, std::vector< const char * > &oModuleLabels) const
 
void modulesWhoseProductsAreConsumed (std::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
 
bool registeredToConsume (ProductHolderIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void updateLookup (BranchType iBranchType, ProductHolderIndexHelper const &)
 
virtual ~EDConsumerBase ()
 

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 &)
 
- Protected Member Functions inherited from edm::EDConsumerBase
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
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 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)
 

Detailed Description

Author
M. Maggi - INFN Bari

Definition at line 30 of file RPCGeometryServTest.h.

Constructor & Destructor Documentation

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

Definition at line 35 of file RPCGeometryServTest.cc.

References gather_cfg::cout.

37  myName_( "RPCGeometryServTest" )
38 {
39  std::cout <<"======================== Opening output file"<< std::endl;
40 }
const std::string myName_
tuple cout
Definition: gather_cfg.py:121
const std::string dashedLine_
RPCGeometryServTest::~RPCGeometryServTest ( )

Definition at line 43 of file RPCGeometryServTest.cc.

44 {
45 }

Member Function Documentation

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

Implements edm::EDAnalyzer.

Definition at line 48 of file RPCGeometryServTest.cc.

References a, bacRranges, barzranges, gather_cfg::cout, dashedLine_, forRranges, g, edm::EventSetup::get(), myName(), RPCChamber::nrolls(), alignCSCRings::r, RPCChamber::rolls(), alignCSCRings::s, and edm::second().

49 {
51  iSetup.get<MuonGeometryRecord>().get( pDD );
52 
53  std::cout << myName() << ": Analyzer..." << std::endl;
54  std::cout << "start " << dashedLine_ << std::endl;
55 
56 
57  std::cout << " Geometry node for RPCGeom is " << &(*pDD) << std::endl;
58  cout << " I have "<<pDD->detTypes().size() << " detTypes" << endl;
59  cout << " I have "<<pDD->detUnits().size() << " detUnits" << endl;
60  cout << " I have "<<pDD->dets().size() << " dets" << endl;
61  cout << " I have "<<pDD->rolls().size() << " rolls" << endl;
62  cout << " I have "<<pDD->chambers().size() << " chambers" << endl;
63 
64  std::cout << myName() << ": Begin iteration over geometry..." << std::endl;
65  std::cout << "iter " << dashedLine_ << std::endl;
66 
67 
68 
69  int iRPCCHcount = 0;
70  LocalPoint a(0.,0.,0.);
71  for(TrackingGeometry::DetContainer::const_iterator it =
72  pDD->dets().begin(); it != pDD->dets().end(); it++){
73 
74  //----------------------- RPCCHAMBER TEST ---------------------------
75 
76  if( dynamic_cast< const RPCChamber* >( *it ) != 0 ){
77  ++iRPCCHcount;
78  const RPCChamber* ch = dynamic_cast< const RPCChamber* >( *it );
79 
80  std::vector< const RPCRoll*> rollsRaf = (ch->rolls());
81  for(std::vector<const RPCRoll*>::iterator r = rollsRaf.begin();
82  r != rollsRaf.end(); ++r){
83  std::cout << dashedLine_ << " NEW ROLL" << std::endl;
84  std::cout<<"Region = "<<(*r)->id().region()
85  <<" Ring = "<<(*r)->id().ring()
86  <<" Station = "<<(*r)->id().station()
87  <<" Sector = "<<(*r)->id().sector()
88  <<" Layer = "<<(*r)->id().layer()
89  <<" Subsector = "<<(*r)->id().subsector()
90  <<" Roll = "<<(*r)->id().roll()<<std::endl;
91  RPCGeomServ s( (*r)->id());
92  GlobalPoint g= (*r)->toGlobal(a);
93  std::cout <<s.name()<<" eta partition "<<s.eta_partition()<< " nroll="<<ch->nrolls()
94  <<" z="<<g.z()<<" phi="<<g.phi()<<" R="<<g.perp()
95  <<std::endl;
96 
97  if((*r)->id().region() == 0 ){
98  if (barzranges.find(s.eta_partition()) != barzranges.end()){
99  std::pair<double, double> cic=barzranges.find(s.eta_partition())->second;
100  double cmin = cic.first;
101  double cmax = cic.second;
102  if (g.z()<cmin)
103  cmin = g.z();
104  if (g.z()>cmax)
105  cmax = g.z();
106  std::pair<double,double> cic2(cmin,cmax);
107  barzranges[s.eta_partition()]=cic2;
108  }else{
109  std::pair<double, double> cic(g.z(),g.z());
110  barzranges[s.eta_partition()]=cic;
111  }
112  }
113  else if((*r)->id().region() == +1 ){
114  if (forRranges.find(s.eta_partition()) != forRranges.end()){
115  std::pair<double, double> cic=forRranges.find(s.eta_partition())->second;
116  double cmin = cic.first;
117  double cmax = cic.second;
118  if (g.perp()<cmin)
119  cmin = g.perp();
120  if (g.perp()>cmax)
121  cmax = g.perp();
122  std::pair<double,double> cic2(cmin,cmax);
123  forRranges[s.eta_partition()]=cic2;
124  }else{
125  std::pair<double, double> cic(g.perp(),g.perp());
126  forRranges[s.eta_partition()]=cic;
127  }
128  }
129  else if((*r)->id().region() == -1 ){
130  if (bacRranges.find(s.eta_partition()) != bacRranges.end()){
131  std::pair<double, double> cic=bacRranges.find(s.eta_partition())->second;
132  double cmin = cic.first;
133  double cmax = cic.second;
134  if (g.perp()<cmin)
135  cmin = g.perp();
136  if (g.perp()>cmax)
137  cmax = g.perp();
138  std::pair<double,double> cic2(cmin,cmax);
139  bacRranges[s.eta_partition()]=cic2;
140  }else{
141  std::pair<double, double> cic(g.perp(),g.perp());
142  bacRranges[s.eta_partition()]=cic;
143  }
144  }
145  }
146  }
147  }
148 
149  std::cout <<std::endl;
150  std::map<int, std::pair<double, double> >::iterator ieta;
151 
152  for (ieta=bacRranges.begin(); ieta != bacRranges.end(); ieta++){
153  std::cout <<" Eta "<<ieta->first<<" Radii = ( "<<ieta->second.first
154  <<", "<<ieta->second.second<<")"<<std::endl;
155  }
156 
157  for (ieta=barzranges.begin(); ieta != barzranges.end(); ieta++){
158  std::cout <<" Eta "<<ieta->first<<" Z = ( "<<ieta->second.first
159  <<", "<<ieta->second.second<<")"<<std::endl;
160  }
161 
162  for (ieta=forRranges.begin(); ieta != forRranges.end(); ieta++){
163  std::cout <<" Eta "<<ieta->first<<" Radii = ( "<<ieta->second.first
164  <<", "<<ieta->second.second<<")"<<std::endl;
165  }
166 
167 
168  std::cout << dashedLine_ << " end" << std::endl;
169 }
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
U second(std::pair< T, U > const &p)
std::map< int, std::pair< double, double > > barzranges
const std::vector< const RPCRoll * > & rolls() const
Return the Rolls.
Definition: RPCChamber.cc:68
std::map< int, std::pair< double, double > > forRranges
const T & get() const
Definition: EventSetup.h:56
double a
Definition: hdecay.h:121
int nrolls() const
Retunr numbers of rolls.
Definition: RPCChamber.cc:74
const std::string & myName()
tuple cout
Definition: gather_cfg.py:121
const std::string dashedLine_
std::map< int, std::pair< double, double > > bacRranges
const std::string& RPCGeometryServTest::myName ( void  )
inline

Definition at line 39 of file RPCGeometryServTest.h.

References myName_.

Referenced by analyze().

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

Member Data Documentation

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

Definition at line 48 of file RPCGeometryServTest.h.

Referenced by analyze().

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

Definition at line 46 of file RPCGeometryServTest.h.

Referenced by analyze().

const std::string RPCGeometryServTest::dashedLine_
private

Definition at line 44 of file RPCGeometryServTest.h.

Referenced by analyze().

const int RPCGeometryServTest::dashedLineWidth_
private

Definition at line 43 of file RPCGeometryServTest.h.

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

Definition at line 47 of file RPCGeometryServTest.h.

Referenced by analyze().

const std::string RPCGeometryServTest::myName_
private

Definition at line 45 of file RPCGeometryServTest.h.

Referenced by myName().