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
Inheritance diagram for RPCGeometryServTest:
edm::EDAnalyzer

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
 EDAnalyzer ()
 
std::string workerType () const
 
virtual ~EDAnalyzer ()
 

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
 
typedef WorkerT< EDAnalyzerWorkerType
 
- Static Public Member Functions inherited from edm::EDAnalyzer
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
- Protected Member Functions inherited from edm::EDAnalyzer
CurrentProcessingContext const * currentContext () const
 

Detailed Description

Definition at line 31 of file RPCGeometryServTest.cc.

Constructor & Destructor Documentation

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

Definition at line 52 of file RPCGeometryServTest.cc.

References gather_cfg::cout.

53  : dashedLineWidth_(104), dashedLine_( std::string(dashedLineWidth_, '-') ),
54  myName_( "RPCGeometryServTest" )
55 {
56  std::cout <<"======================== Opening output file"<< std::endl;
57 }
const std::string myName_
tuple cout
Definition: gather_cfg.py:41
const std::string dashedLine_
RPCGeometryServTest::~RPCGeometryServTest ( )

Definition at line 60 of file RPCGeometryServTest.cc.

61 {
62 }

Member Function Documentation

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

Implements edm::EDAnalyzer.

Definition at line 65 of file RPCGeometryServTest.cc.

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

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

Definition at line 40 of file RPCGeometryServTest.cc.

Referenced by analyze().

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

Member Data Documentation

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

Definition at line 49 of file RPCGeometryServTest.cc.

Referenced by analyze().

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

Definition at line 47 of file RPCGeometryServTest.cc.

Referenced by analyze().

const std::string RPCGeometryServTest::dashedLine_
private

Definition at line 45 of file RPCGeometryServTest.cc.

Referenced by analyze().

const int RPCGeometryServTest::dashedLineWidth_
private

Definition at line 44 of file RPCGeometryServTest.cc.

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

Definition at line 48 of file RPCGeometryServTest.cc.

Referenced by analyze().

const std::string RPCGeometryServTest::myName_
private

Definition at line 46 of file RPCGeometryServTest.cc.