CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Public Attributes | Private Attributes
RPCEfficiency Class Reference

#include <RPCEfficiency.h>

Inheritance diagram for RPCEfficiency:
edm::EDAnalyzer

Public Member Functions

virtual void analyze (const edm::Event &, const edm::EventSetup &)
 
virtual void beginJob ()
 
virtual void beginRun (const edm::Run &, const edm::EventSetup &)
 
std::map< std::string,
MonitorElement * > 
bookDetUnitSeg (RPCDetId &detId, int nstrips, std::string folder)
 
virtual void endJob ()
 
virtual void endRun (const edm::Run &r, const edm::EventSetup &iSetup)
 
 RPCEfficiency (const edm::ParameterSet &)
 
 ~RPCEfficiency ()
 
- Public Member Functions inherited from edm::EDAnalyzer
 EDAnalyzer ()
 
std::string workerType () const
 
virtual ~EDAnalyzer ()
 

Public Attributes

MonitorElementAngClu1La1
 
MonitorElementAngClu1La2
 
MonitorElementAngClu1La3
 
MonitorElementAngClu1La4
 
MonitorElementAngClu1La5
 
MonitorElementAngClu1La6
 
MonitorElementAngClu2La1
 
MonitorElementAngClu2La2
 
MonitorElementAngClu2La3
 
MonitorElementAngClu2La4
 
MonitorElementAngClu2La5
 
MonitorElementAngClu2La6
 
MonitorElementAngClu3La1
 
MonitorElementAngClu3La2
 
MonitorElementAngClu3La3
 
MonitorElementAngClu3La4
 
MonitorElementAngClu3La5
 
MonitorElementAngClu3La6
 
edm::ESHandle< CSCGeometrycscGeo
 
MonitorElementDistBorderClu1La1
 
MonitorElementDistBorderClu1La2
 
MonitorElementDistBorderClu1La3
 
MonitorElementDistBorderClu1La4
 
MonitorElementDistBorderClu1La5
 
MonitorElementDistBorderClu1La6
 
MonitorElementDistBorderClu2La1
 
MonitorElementDistBorderClu2La2
 
MonitorElementDistBorderClu2La3
 
MonitorElementDistBorderClu2La4
 
MonitorElementDistBorderClu2La5
 
MonitorElementDistBorderClu2La6
 
MonitorElementDistBorderClu3La1
 
MonitorElementDistBorderClu3La2
 
MonitorElementDistBorderClu3La3
 
MonitorElementDistBorderClu3La4
 
MonitorElementDistBorderClu3La5
 
MonitorElementDistBorderClu3La6
 
edm::ESHandle< DTGeometrydtGeo
 
MonitorElementhGlobalResClu1La1
 
MonitorElementhGlobalResClu1La2
 
MonitorElementhGlobalResClu1La3
 
MonitorElementhGlobalResClu1La4
 
MonitorElementhGlobalResClu1La5
 
MonitorElementhGlobalResClu1La6
 
MonitorElementhGlobalResClu1R2A
 
MonitorElementhGlobalResClu1R2B
 
MonitorElementhGlobalResClu1R2C
 
MonitorElementhGlobalResClu1R3A
 
MonitorElementhGlobalResClu1R3B
 
MonitorElementhGlobalResClu1R3C
 
MonitorElementhGlobalResClu2La1
 
MonitorElementhGlobalResClu2La2
 
MonitorElementhGlobalResClu2La3
 
MonitorElementhGlobalResClu2La4
 
MonitorElementhGlobalResClu2La5
 
MonitorElementhGlobalResClu2La6
 
MonitorElementhGlobalResClu2R2A
 
MonitorElementhGlobalResClu2R2B
 
MonitorElementhGlobalResClu2R2C
 
MonitorElementhGlobalResClu2R3A
 
MonitorElementhGlobalResClu2R3B
 
MonitorElementhGlobalResClu2R3C
 
MonitorElementhGlobalResClu3La1
 
MonitorElementhGlobalResClu3La2
 
MonitorElementhGlobalResClu3La3
 
MonitorElementhGlobalResClu3La4
 
MonitorElementhGlobalResClu3La5
 
MonitorElementhGlobalResClu3La6
 
MonitorElementhGlobalResClu3R2A
 
MonitorElementhGlobalResClu3R2B
 
MonitorElementhGlobalResClu3R2C
 
MonitorElementhGlobalResClu3R3A
 
MonitorElementhGlobalResClu3R3B
 
MonitorElementhGlobalResClu3R3C
 
std::map< CSCStationIndex,
std::set< RPCDetId > > 
rollstoreCSC
 
std::map< DTStationIndex,
std::set< RPCDetId > > 
rollstoreDT
 
edm::ESHandle< RPCGeometryrpcGeo
 
edm::InputTag RPCRecHitLabel_
 
MonitorElementstatistics
 

Private Attributes

std::vector< std::map
< RPCDetId, int > > 
counter
 
std::string cscSegments
 
DQMStoredbe
 
bool debug
 
std::string dt4DSegments
 
int dupli
 
std::string EffRootFileName
 
bool EffSaveRootFile
 
std::string folderPath
 
bool inclcsc
 
bool incldt
 
bool incldtMB4
 
bool inves
 
double MaxD
 
double MaxDrb4
 
std::map< int, std::map
< std::string, MonitorElement * > > 
meCollection
 
double MinCosAng
 
std::string muonRPCDigis
 
std::string nameInLog
 
std::ofstream ofrej
 
bool paper
 
double rangestrips
 
double rangestripsRB4
 
std::string rejected
 
std::string rollseff
 
std::vector< int > totalcounter
 

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

Class for RPC Monitoring: uses RPCDigi and DT and CSC Segments.

Date:
2010/09/20 14:39:10
Revision:
1.3
Author
Camilo Carrillo (Uniandes)

Definition at line 104 of file RPCEfficiency.h.

Constructor & Destructor Documentation

RPCEfficiency::RPCEfficiency ( const edm::ParameterSet iConfig)
explicit

Definition at line 49 of file RPCEfficiency.cc.

References gather_cfg::cout, cscSegments, dbe, debug, dt4DSegments, dupli, EffRootFileName, EffSaveRootFile, folderPath, edm::ParameterSet::getParameter(), edm::ParameterSet::getUntrackedParameter(), hGlobalResClu1La1, hGlobalResClu1La2, hGlobalResClu1La3, hGlobalResClu1La4, hGlobalResClu1La5, hGlobalResClu1La6, hGlobalResClu1R2A, hGlobalResClu1R2B, hGlobalResClu1R2C, hGlobalResClu1R3A, hGlobalResClu1R3B, hGlobalResClu1R3C, hGlobalResClu2La1, hGlobalResClu2La2, hGlobalResClu2La3, hGlobalResClu2La4, hGlobalResClu2La5, hGlobalResClu2La6, hGlobalResClu2R2A, hGlobalResClu2R2B, hGlobalResClu2R2C, hGlobalResClu2R3A, hGlobalResClu2R3B, hGlobalResClu2R3C, hGlobalResClu3La1, hGlobalResClu3La2, hGlobalResClu3La3, hGlobalResClu3La4, hGlobalResClu3La5, hGlobalResClu3La6, hGlobalResClu3R2A, hGlobalResClu3R2B, hGlobalResClu3R2C, hGlobalResClu3R3A, hGlobalResClu3R3B, hGlobalResClu3R3C, inclcsc, incldt, incldtMB4, MaxD, MaxDrb4, MinCosAng, muonRPCDigis, nameInLog, ofrej, cmsCodeRules.cppFunctionSkipper::operator, rangestrips, rangestripsRB4, RPCRecHitLabel_, and statistics.

49  {
50  incldt=iConfig.getUntrackedParameter<bool>("incldt",true);
51  incldtMB4=iConfig.getUntrackedParameter<bool>("incldtMB4",true);
52  inclcsc=iConfig.getUntrackedParameter<bool>("inclcsc",true);
53  debug=iConfig.getUntrackedParameter<bool>("debug",false);
54 
55  rangestrips = iConfig.getUntrackedParameter<double>("rangestrips",4.);
56  rangestripsRB4=iConfig.getUntrackedParameter<double>("rangestripsRB4",4.);
57  dupli = iConfig.getUntrackedParameter<int>("DuplicationCorrection",2);
58  MinCosAng=iConfig.getUntrackedParameter<double>("MinCosAng",0.96);
59  MaxD=iConfig.getUntrackedParameter<double>("MaxD",80.);
60  MaxDrb4=iConfig.getUntrackedParameter<double>("MaxDrb4",150.);
61  muonRPCDigis=iConfig.getUntrackedParameter<std::string>("muonRPCDigis","muonRPCDigis");
62  RPCRecHitLabel_ = iConfig.getParameter<edm::InputTag>("RecHitLabel");
63  cscSegments=iConfig.getUntrackedParameter<std::string>("cscSegments","cscSegments");
64  dt4DSegments=iConfig.getUntrackedParameter<std::string>("dt4DSegments","dt4DSegments");
65 
66  folderPath=iConfig.getUntrackedParameter<std::string>("folderPath","RPC/RPCEfficiency/");
67 
68  nameInLog = iConfig.getUntrackedParameter<std::string>("moduleLogName", "RPC_Eff");
69  EffSaveRootFile = iConfig.getUntrackedParameter<bool>("EffSaveRootFile", false);
70  EffRootFileName = iConfig.getUntrackedParameter<std::string>("EffRootFileName", "RPCEfficiency.root");
71 
72  //Interface
73 
75 
76  std::string folder = folderPath+"MuonSegEff";
77  dbe->setCurrentFolder(folder);
78  statistics = dbe->book1D("Statistics","All Statistics",33,0.5,33.5);
79 
80  if(debug) std::cout<<"booking Global histograms with "<<folderPath<<std::endl;
81 
82  folder = folderPath+"MuonSegEff/"+"Residuals/Barrel";
83  dbe->setCurrentFolder(folder);
84 
85  //Barrel
86  hGlobalResClu1La1 = dbe->book1D("GlobalResidualsClu1La1","RPC Residuals Layer 1 Cluster Size 1",101,-10.,10.);
87  hGlobalResClu1La2 = dbe->book1D("GlobalResidualsClu1La2","RPC Residuals Layer 2 Cluster Size 1",101,-10.,10.);
88  hGlobalResClu1La3 = dbe->book1D("GlobalResidualsClu1La3","RPC Residuals Layer 3 Cluster Size 1",101,-10.,10.);
89  hGlobalResClu1La4 = dbe->book1D("GlobalResidualsClu1La4","RPC Residuals Layer 4 Cluster Size 1",101,-10.,10.);
90  hGlobalResClu1La5 = dbe->book1D("GlobalResidualsClu1La5","RPC Residuals Layer 5 Cluster Size 1",101,-10.,10.);
91  hGlobalResClu1La6 = dbe->book1D("GlobalResidualsClu1La6","RPC Residuals Layer 6 Cluster Size 1",101,-10.,10.);
92 
93  hGlobalResClu2La1 = dbe->book1D("GlobalResidualsClu2La1","RPC Residuals Layer 1 Cluster Size 2",101,-10.,10.);
94  hGlobalResClu2La2 = dbe->book1D("GlobalResidualsClu2La2","RPC Residuals Layer 2 Cluster Size 2",101,-10.,10.);
95  hGlobalResClu2La3 = dbe->book1D("GlobalResidualsClu2La3","RPC Residuals Layer 3 Cluster Size 2",101,-10.,10.);
96  hGlobalResClu2La4 = dbe->book1D("GlobalResidualsClu2La4","RPC Residuals Layer 4 Cluster Size 2",101,-10.,10.);
97  hGlobalResClu2La5 = dbe->book1D("GlobalResidualsClu2La5","RPC Residuals Layer 5 Cluster Size 2",101,-10.,10.);
98  hGlobalResClu2La6 = dbe->book1D("GlobalResidualsClu2La6","RPC Residuals Layer 6 Cluster Size 2",101,-10.,10.);
99 
100  hGlobalResClu3La1 = dbe->book1D("GlobalResidualsClu3La1","RPC Residuals Layer 1 Cluster Size 3",101,-10.,10.);
101  hGlobalResClu3La2 = dbe->book1D("GlobalResidualsClu3La2","RPC Residuals Layer 2 Cluster Size 3",101,-10.,10.);
102  hGlobalResClu3La3 = dbe->book1D("GlobalResidualsClu3La3","RPC Residuals Layer 3 Cluster Size 3",101,-10.,10.);
103  hGlobalResClu3La4 = dbe->book1D("GlobalResidualsClu3La4","RPC Residuals Layer 4 Cluster Size 3",101,-10.,10.);
104  hGlobalResClu3La5 = dbe->book1D("GlobalResidualsClu3La5","RPC Residuals Layer 5 Cluster Size 3",101,-10.,10.);
105  hGlobalResClu3La6 = dbe->book1D("GlobalResidualsClu3La6","RPC Residuals Layer 6 Cluster Size 3",101,-10.,10.);
106 
107  if(debug) std::cout<<"Booking Residuals for EndCap"<<std::endl;
108  folder = folderPath+"MuonSegEff/Residuals/EndCap";
109  dbe->setCurrentFolder(folder);
110 
111  //Endcap
112  hGlobalResClu1R3C = dbe->book1D("GlobalResidualsClu1R3C","RPC Residuals Ring 3 Roll C Cluster Size 1",101,-10.,10.);
113  hGlobalResClu1R3B = dbe->book1D("GlobalResidualsClu1R3B","RPC Residuals Ring 3 Roll B Cluster Size 1",101,-10.,10.);
114  hGlobalResClu1R3A = dbe->book1D("GlobalResidualsClu1R3A","RPC Residuals Ring 3 Roll A Cluster Size 1",101,-10.,10.);
115  hGlobalResClu1R2C = dbe->book1D("GlobalResidualsClu1R2C","RPC Residuals Ring 2 Roll C Cluster Size 1",101,-10.,10.);
116  hGlobalResClu1R2B = dbe->book1D("GlobalResidualsClu1R2B","RPC Residuals Ring 2 Roll B Cluster Size 1",101,-10.,10.);
117  hGlobalResClu1R2A = dbe->book1D("GlobalResidualsClu1R2A","RPC Residuals Ring 2 Roll A Cluster Size 1",101,-10.,10.);
118 
119  hGlobalResClu2R3C = dbe->book1D("GlobalResidualsClu2R3C","RPC Residuals Ring 3 Roll C Cluster Size 2",101,-10.,10.);
120  hGlobalResClu2R3B = dbe->book1D("GlobalResidualsClu2R3B","RPC Residuals Ring 3 Roll B Cluster Size 2",101,-10.,10.);
121  hGlobalResClu2R3A = dbe->book1D("GlobalResidualsClu2R3A","RPC Residuals Ring 3 Roll A Cluster Size 2",101,-10.,10.);
122  hGlobalResClu2R2C = dbe->book1D("GlobalResidualsClu2R2C","RPC Residuals Ring 2 Roll C Cluster Size 2",101,-10.,10.);
123  hGlobalResClu2R2B = dbe->book1D("GlobalResidualsClu2R2B","RPC Residuals Ring 2 Roll B Cluster Size 2",101,-10.,10.);
124  hGlobalResClu2R2A = dbe->book1D("GlobalResidualsClu2R2A","RPC Residuals Ring 2 Roll A Cluster Size 2",101,-10.,10.);
125 
126  hGlobalResClu3R3C = dbe->book1D("GlobalResidualsClu3R3C","RPC Residuals Ring 3 Roll C Cluster Size 3",101,-10.,10.);
127  hGlobalResClu3R3B = dbe->book1D("GlobalResidualsClu3R3B","RPC Residuals Ring 3 Roll B Cluster Size 3",101,-10.,10.);
128  hGlobalResClu3R3A = dbe->book1D("GlobalResidualsClu3R3A","RPC Residuals Ring 3 Roll A Cluster Size 3",101,-10.,10.);
129  hGlobalResClu3R2C = dbe->book1D("GlobalResidualsClu3R2C","RPC Residuals Ring 2 Roll C Cluster Size 3",101,-10.,10.);
130  hGlobalResClu3R2B = dbe->book1D("GlobalResidualsClu3R2B","RPC Residuals Ring 2 Roll B Cluster Size 3",101,-10.,10.);
131  hGlobalResClu3R2A = dbe->book1D("GlobalResidualsClu3R2A","RPC Residuals Ring 2 Roll A Cluster Size 3",101,-10.,10.);
132 
133 
134  if(debug) ofrej.open("rejected.txt");
135 
136  if(debug) std::cout<<"Rejected done"<<std::endl;
137 
138 }
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
MonitorElement * hGlobalResClu1La3
MonitorElement * hGlobalResClu1R2A
MonitorElement * book1D(const char *name, const char *title, int nchX, double lowX, double highX)
Book 1D histogram.
Definition: DQMStore.cc:519
MonitorElement * hGlobalResClu1R3A
std::string muonRPCDigis
MonitorElement * hGlobalResClu3R2C
MonitorElement * hGlobalResClu3La1
MonitorElement * hGlobalResClu3R3C
MonitorElement * hGlobalResClu2La2
std::ofstream ofrej
DQMStore * dbe
std::string EffRootFileName
MonitorElement * hGlobalResClu3La3
MonitorElement * hGlobalResClu1La6
std::string dt4DSegments
std::string folderPath
MonitorElement * hGlobalResClu3R2A
MonitorElement * hGlobalResClu2La5
double rangestripsRB4
MonitorElement * hGlobalResClu1La4
MonitorElement * hGlobalResClu1R3B
MonitorElement * hGlobalResClu1R2C
MonitorElement * hGlobalResClu2R3C
MonitorElement * hGlobalResClu3R3A
MonitorElement * statistics
MonitorElement * hGlobalResClu2La4
std::string nameInLog
MonitorElement * hGlobalResClu1La1
MonitorElement * hGlobalResClu2La6
MonitorElement * hGlobalResClu2R2A
MonitorElement * hGlobalResClu2R3A
edm::InputTag RPCRecHitLabel_
double rangestrips
MonitorElement * hGlobalResClu3La2
MonitorElement * hGlobalResClu3La5
MonitorElement * hGlobalResClu2La1
MonitorElement * hGlobalResClu2La3
MonitorElement * hGlobalResClu3La6
tuple cout
Definition: gather_cfg.py:41
MonitorElement * hGlobalResClu1R3C
MonitorElement * hGlobalResClu2R2B
MonitorElement * hGlobalResClu3R3B
MonitorElement * hGlobalResClu1La5
MonitorElement * hGlobalResClu3R2B
std::string cscSegments
MonitorElement * hGlobalResClu2R3B
MonitorElement * hGlobalResClu3La4
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:237
MonitorElement * hGlobalResClu1R2B
MonitorElement * hGlobalResClu2R2C
MonitorElement * hGlobalResClu1La2
RPCEfficiency::~RPCEfficiency ( )

Definition at line 267 of file RPCEfficiency.cc.

268 {
269 
270 }

Member Function Documentation

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

Implements edm::EDAnalyzer.

Definition at line 272 of file RPCEfficiency.cc.

References PV3DBase< T, PVType, FrameType >::barePhi(), CSCDetId::chamber(), gather_cfg::cout, cscGeo, cscSegments, debug, distsector(), dt4DSegments, dtGeo, dupli, CSCDetId::endcap(), edm::EventID::event(), MonitorElement::Fill(), edm::Event::getByLabel(), hGlobalResClu1La1, hGlobalResClu1La2, hGlobalResClu1La3, hGlobalResClu1La4, hGlobalResClu1La5, hGlobalResClu1La6, hGlobalResClu1R2A, hGlobalResClu1R2B, hGlobalResClu1R2C, hGlobalResClu1R3A, hGlobalResClu1R3B, hGlobalResClu1R3C, hGlobalResClu2La1, hGlobalResClu2La2, hGlobalResClu2La3, hGlobalResClu2La4, hGlobalResClu2La5, hGlobalResClu2La6, hGlobalResClu2R2A, hGlobalResClu2R2B, hGlobalResClu2R2C, hGlobalResClu2R3A, hGlobalResClu2R3B, hGlobalResClu2R3C, hGlobalResClu3La1, hGlobalResClu3La2, hGlobalResClu3La3, hGlobalResClu3La4, hGlobalResClu3La5, hGlobalResClu3La6, hGlobalResClu3R2A, hGlobalResClu3R2B, hGlobalResClu3R2C, hGlobalResClu3R3A, hGlobalResClu3R3B, hGlobalResClu3R3C, RPCRoll::id(), CSCChamber::id(), edm::EventBase::id(), inclcsc, incldt, incldtMB4, edm::HandleBase::isValid(), RPCDetId::layer(), RectangularStripTopology::localPosition(), TrapezoidalStripTopology::localPosition(), MaxD, MaxDrb4, meCollection, MinCosAng, RPCGeomServ::name(), RPCRoll::nstrips(), ofrej, PV3DBase< T, PVType, FrameType >::perp(), RectangularStripTopology::pitch(), TrapezoidalStripTopology::pitch(), rangestrips, DetId::rawId(), RPCDetId::ring(), CSCDetId::ring(), RPCDetId::roll(), rollstoreCSC, rollstoreDT, rpcGeo, RPCRecHitLabel_, edm::EventID::run(), DTChamberId::sector(), mathSSE::sqrt(), DTChamberId::station(), CSCDetId::station(), RPCDetId::station(), statistics, RPCRoll::strip(), RectangularStripTopology::stripLength(), TrapezoidalStripTopology::stripLength(), GeomDet::surface(), GeomDet::toGlobal(), Surface::toGlobal(), GeomDet::toLocal(), GloballyPositioned< T >::toLocal(), RPCRoll::topology(), DTChamberId::wheel(), X, PV3DBase< T, PVType, FrameType >::x(), PV3DBase< T, PVType, FrameType >::y(), Gflash::Z, and PV3DBase< T, PVType, FrameType >::z().

273 {
274 
275  statistics->Fill(1);
276 
277  char meIdRPC [128];
278  char meIdDT [128];
279  char meIdCSC [128];
280 
281  if(debug) std::cout <<"\t Getting the RPC RecHits"<<std::endl;
283  iEvent.getByLabel(RPCRecHitLabel_,rpcHits);
284 
285 
286  if(rpcHits.isValid()){
287  if(incldt){
288  if(debug) std::cout<<"\t Getting the DT Segments"<<std::endl;
290 
291  iEvent.getByLabel(dt4DSegments, all4DSegments);
292 
293  if(all4DSegments.isValid()){
294  if(all4DSegments->size()>0){
295  if(all4DSegments->size()<=16) statistics->Fill(2);
296 
297  if(debug) std::cout<<"\t Number of DT Segments in this event = "<<all4DSegments->size()<<std::endl;
298 
299  std::map<DTChamberId,int> DTSegmentCounter;
301 
302  for (segment = all4DSegments->begin();segment!=all4DSegments->end(); ++segment){
303  DTSegmentCounter[segment->chamberId()]++;
304  }
305 
306  statistics->Fill(all4DSegments->size()+2);
307 
308  if(debug) std::cout<<"\t Loop over all the 4D Segments"<<std::endl;
309  for (segment = all4DSegments->begin(); segment != all4DSegments->end(); ++segment){
310 
311  DTChamberId DTId = segment->chamberId();
312 
313 
314  if(debug) std::cout<<"DT \t \t This Segment is in Chamber id: "<<DTId<<std::endl;
315  if(debug) std::cout<<"DT \t \t Number of segments in this DT = "<<DTSegmentCounter[DTId]<<std::endl;
316  if(debug) std::cout<<"DT \t \t Is the only one in this DT? and is not in the 4th Station?"<<std::endl;
317 
318 
319  if(DTSegmentCounter[DTId]==1 && DTId.station()!=4){
320 
321  int dtWheel = DTId.wheel();
322  int dtStation = DTId.station();
323  int dtSector = DTId.sector();
324 
325  LocalPoint segmentPosition= segment->localPosition();
326  LocalVector segmentDirection=segment->localDirection();
327 
328  const GeomDet* gdet=dtGeo->idToDet(segment->geographicalId());
329  const BoundPlane & DTSurface = gdet->surface();
330 
331  //check if the dimension of the segment is 4
332 
333  if(debug) std::cout<<"DT \t \t Is the segment 4D?"<<std::endl;
334 
335  if(segment->dimension()==4){
336 
337  if(debug) std::cout<<"DT \t \t yes"<<std::endl;
338  if(debug) std::cout<<"DT \t \t DT Segment Dimension "<<segment->dimension()<<std::endl;
339 
340  float Xo=segmentPosition.x();
341  float Yo=segmentPosition.y();
342  float Zo=segmentPosition.z();
343  float dx=segmentDirection.x();
344  float dy=segmentDirection.y();
345  float dz=segmentDirection.z();
346 
347  std::set<RPCDetId> rollsForThisDT = rollstoreDT[DTStationIndex(0,dtWheel,dtSector,dtStation)];
348 
349  if(debug) std::cout<<"DT \t \t Number of rolls for this DT = "<<rollsForThisDT.size()<<std::endl;
350 
351  assert(rollsForThisDT.size()>=1);
352 
353  if(debug) std::cout<<"DT \t \t Loop over all the rolls asociated to this DT"<<std::endl;
354  for (std::set<RPCDetId>::iterator iteraRoll = rollsForThisDT.begin();iteraRoll != rollsForThisDT.end(); iteraRoll++){
355  const RPCRoll* rollasociated = rpcGeo->roll(*iteraRoll);
356  RPCDetId rpcId = rollasociated->id();
357  const BoundPlane & RPCSurface = rollasociated->surface();
358 
359  RPCGeomServ rpcsrv(rpcId);
360  std::string nameRoll = rpcsrv.name();
361 
362  if(debug) std::cout<<"DT \t \t \t RollName: "<<nameRoll<<std::endl;
363  if(debug) std::cout<<"DT \t \t \t Doing the extrapolation to this roll"<<std::endl;
364  if(debug) std::cout<<"DT \t \t \t DT Segment Direction in DTLocal "<<segmentDirection<<std::endl;
365  if(debug) std::cout<<"DT \t \t \t DT Segment Point in DTLocal "<<segmentPosition<<std::endl;
366 
367  GlobalPoint CenterPointRollGlobal = RPCSurface.toGlobal(LocalPoint(0,0,0));
368 
369  LocalPoint CenterRollinDTFrame = DTSurface.toLocal(CenterPointRollGlobal);
370 
371  if(debug) std::cout<<"DT \t \t \t Center (0,0,0) Roll In DTLocal"<<CenterRollinDTFrame<<std::endl;
372  if(debug) std::cout<<"DT \t \t \t Center (0,0,0) of the Roll in Global"<<CenterPointRollGlobal<<std::endl;
373 
374  float D=CenterRollinDTFrame.z();
375 
376  float X=Xo+dx*D/dz;
377  float Y=Yo+dy*D/dz;
378  float Z=D;
379 
380  const RectangularStripTopology* top_= dynamic_cast<const RectangularStripTopology*> (&(rollasociated->topology()));
381  LocalPoint xmin = top_->localPosition(0.);
382  if(debug) std::cout<<"DT \t \t \t xmin of this Roll "<<xmin<<"cm"<<std::endl;
383  LocalPoint xmax = top_->localPosition((float)rollasociated->nstrips());
384  if(debug) std::cout<<"DT \t \t \t xmax of this Roll "<<xmax<<"cm"<<std::endl;
385  float rsize = fabs( xmax.x()-xmin.x() );
386  if(debug) std::cout<<"DT \t \t \t Roll Size "<<rsize<<"cm"<<std::endl;
387  float stripl = top_->stripLength();
388  float stripw = top_->pitch();
389 
390  if(debug) std::cout<<"DT \t \t \t Strip Lenght "<<stripl<<"cm"<<std::endl;
391  if(debug) std::cout<<"DT \t \t \t Strip Width "<<stripw<<"cm"<<std::endl;
392  if(debug) std::cout<<"DT \t \t \t X Predicted in DTLocal= "<<X<<"cm"<<std::endl;
393  if(debug) std::cout<<"DT \t \t \t Y Predicted in DTLocal= "<<Y<<"cm"<<std::endl;
394  if(debug) std::cout<<"DT \t \t \t Z Predicted in DTLocal= "<<Z<<"cm"<<std::endl;
395 
396  float extrapolatedDistance = sqrt((X-Xo)*(X-Xo)+(Y-Yo)*(Y-Yo)+(Z-Zo)*(Z-Zo));
397 
398  if(debug) std::cout<<"DT \t \t \t Is the distance of extrapolation less than MaxD? ="<<extrapolatedDistance<<"cm"<<"MaxD="<<MaxD<<"cm"<<std::endl;
399 
400  if(extrapolatedDistance<=MaxD){
401  if(debug) std::cout<<"DT \t \t \t yes"<<std::endl;
402  GlobalPoint GlobalPointExtrapolated = DTSurface.toGlobal(LocalPoint(X,Y,Z));
403  if(debug) std::cout<<"DT \t \t \t Point ExtraPolated in Global"<<GlobalPointExtrapolated<< std::endl;
404  LocalPoint PointExtrapolatedRPCFrame = RPCSurface.toLocal(GlobalPointExtrapolated);
405 
406  if(debug) std::cout<<"DT \t \t \t Point Extrapolated in RPCLocal"<<PointExtrapolatedRPCFrame<< std::endl;
407  if(debug) std::cout<<"DT \t \t \t Corner of the Roll = ("<<rsize*0.5<<","<<stripl*0.5<<")"<<std::endl;
408  if(debug) std::cout<<"DT \t \t \t Info About the Point Extrapolated in X Abs ("<<fabs(PointExtrapolatedRPCFrame.x())<<","
409  <<fabs(PointExtrapolatedRPCFrame.y())<<","<<fabs(PointExtrapolatedRPCFrame.z())<<")"<<std::endl;
410  if(debug) std::cout<<"DT \t \t \t Does the extrapolation go inside this roll?"<<std::endl;
411 
412  if(fabs(PointExtrapolatedRPCFrame.z()) < 10. &&
413  fabs(PointExtrapolatedRPCFrame.x()) < rsize*0.5 &&
414  fabs(PointExtrapolatedRPCFrame.y()) < stripl*0.5){
415 
416  if(debug) std::cout<<"DT \t \t \t \t yes"<<std::endl;
417 
418  RPCDetId rollId = rollasociated->id();
419 
420  RPCGeomServ rpcsrv(rollId);
421  std::string nameRoll = rpcsrv.name();
422  if(debug) std::cout<<"DT \t \t \t \t The RPCName is "<<nameRoll<<std::endl;
423  const float stripPredicted =
424  rollasociated->strip(LocalPoint(PointExtrapolatedRPCFrame.x(),PointExtrapolatedRPCFrame.y(),0.));
425 
426  if(debug) std::cout<<"DT \t \t \t \t Candidate (from DT Segment) STRIP---> "<<stripPredicted<< std::endl;
427  //---- HISTOGRAM STRIP PREDICTED FROM DT ----
428 
429  std::map<std::string, MonitorElement*> meMap=meCollection[rpcId.rawId()];
430 
431  sprintf(meIdDT,"ExpectedOccupancyFromDT_%d",rollId.rawId());
432  if(debug) std::cout<<"DT \t \t \t \t Filling Expected for "<<meIdDT<<" with "<<stripPredicted<<std::endl;
433  if(fabs(stripPredicted-rollasociated->nstrips())<1.) if(debug) std::cout<<"DT \t \t \t \t Extrapolating near last strip, Event"<<iEvent.id()<<" stripPredicted="<<stripPredicted<<" Number of strips="<<rollasociated->nstrips()<<std::endl;
434  if(fabs(stripPredicted)<1.) if(debug) std::cout<<"DT \t \t \t \t Extrapolating near first strip, Event"<<iEvent.id()<<" stripPredicted="<<stripPredicted<<" Number of strips="<<rollasociated->nstrips()<<std::endl;
435  meMap[meIdDT]->Fill(stripPredicted);
436  //-----------------------------------------------------
437 
438 
439  //-------RecHitPart Just For Residual--------
440  int countRecHits = 0;
441  int cluSize = 0;
442  float minres = 3000.;
443 
444  if(debug) std::cout<<"DT \t \t \t \t Getting RecHits in Roll Asociated"<<std::endl;
445  typedef std::pair<RPCRecHitCollection::const_iterator, RPCRecHitCollection::const_iterator> rangeRecHits;
446  rangeRecHits recHitCollection = rpcHits->get(rollasociated->id());
448 
449  for (recHit = recHitCollection.first; recHit != recHitCollection.second ; recHit++) {
450  countRecHits++;
451 
452  sprintf(meIdRPC,"BXDistribution_%d",rollasociated->id().rawId());
453  meMap[meIdRPC]->Fill(recHit->BunchX());
454 
455  LocalPoint recHitPos=recHit->localPosition();
456  float res=PointExtrapolatedRPCFrame.x()- recHitPos.x();
457  if(debug) std::cout<<"DT \t \t \t \t \t Found Rec Hit at "<<res<<"cm of the prediction."<<std::endl;
458  if(fabs(res)<fabs(minres)){
459  minres=res;
460  cluSize = recHit->clusterSize();
461  if(debug) std::cout<<"DT \t \t \t \t \t \t New Min Res "<<res<<"cm."<<std::endl;
462  }
463  }
464 
465  bool anycoincidence=false;
466 
467  if(countRecHits==0){
468  if(debug) std::cout <<"DT \t \t \t \t \t THIS ROLL DOESN'T HAVE ANY RECHIT"<<std::endl;
469  }else{
470  assert(minres!=3000);
471 
472  if(debug) std::cout<<"DT \t \t \t \t \t PointExtrapolatedRPCFrame.x="<<PointExtrapolatedRPCFrame.x()<<" Minimal Residual="<<minres<<std::endl;
473  if(debug) std::cout<<"DT \t \t \t \t \t Minimal Residual less than stripw*rangestrips? minres="<<minres<<" range="<<rangestrips<<" stripw="<<stripw<<" cluSize"<<cluSize<<" <=compare minres with"<<(rangestrips+cluSize*0.5)*stripw<<std::endl;
474  if(fabs(minres)<=(rangestrips+cluSize*0.5)*stripw){
475  if(debug) std::cout<<"DT \t \t \t \t \t \t True!"<<std::endl;
476  anycoincidence=true;
477  }
478  }
479  if(anycoincidence){
480  if(debug) std::cout<<"DT \t \t \t \t \t At least one RecHit inside the range, Predicted="<<stripPredicted<<" minres="<<minres<<"cm range="<<rangestrips<<"strips stripw="<<stripw<<"cm"<<std::endl;
481  if(debug) std::cout<<"DT \t \t \t \t \t Norm of Cosine Directors="<<dx*dx+dy*dy+dz*dz<<"~1?"<<std::endl;
482 
483  float cosal = dx/sqrt(dx*dx+dz*dz);
484  if(debug) std::cout<<"DT \t \t \t \t \t Angle="<<acos(cosal)*180/3.1415926<<" degree"<<std::endl;
485  if(debug) std::cout<<"DT \t \t \t \t \t Filling the Residuals Histogram for globals with "<<minres<<"And the angular incidence with Cos Alpha="<<cosal<<std::endl;
486  if(rollId.station()==1&&rollId.layer()==1) { if(cluSize==1*dupli) {hGlobalResClu1La1->Fill(minres);}if(cluSize==2*dupli){ hGlobalResClu2La1->Fill(minres);} else if(cluSize==3*dupli){ hGlobalResClu3La1->Fill(minres);}}
487  else if(rollId.station()==1&&rollId.layer()==2){ if(cluSize==1*dupli) {hGlobalResClu1La2->Fill(minres);}if(cluSize==2*dupli){ hGlobalResClu2La2->Fill(minres);} else if(cluSize==3*dupli){ hGlobalResClu3La2->Fill(minres);}}
488  else if(rollId.station()==2&&rollId.layer()==1){ if(cluSize==1*dupli) {hGlobalResClu1La3->Fill(minres);}if(cluSize==2*dupli){ hGlobalResClu2La3->Fill(minres);} else if(cluSize==3*dupli){ hGlobalResClu3La3->Fill(minres);}}
489  else if(rollId.station()==2&&rollId.layer()==2){ if(cluSize==1*dupli) {hGlobalResClu1La4->Fill(minres);}if(cluSize==2*dupli){ hGlobalResClu2La4->Fill(minres);} else if(cluSize==3*dupli){ hGlobalResClu3La4->Fill(minres);}}
490  else if(rollId.station()==3) { if(cluSize==1*dupli) {hGlobalResClu1La5->Fill(minres);}if(cluSize==2*dupli){ hGlobalResClu2La5->Fill(minres);} else if(cluSize==3*dupli){ hGlobalResClu3La5->Fill(minres);}}
491 
492  sprintf(meIdRPC,"RPCDataOccupancyFromDT_%d",rollId.rawId());
493  if(debug) std::cout<<"DT \t \t \t \t \t COINCIDENCE!!! Event="<<iEvent.id()<<" Filling RPC Data Occupancy for "<<meIdRPC<<" with "<<stripPredicted<<std::endl;
494  meMap[meIdRPC]->Fill(stripPredicted);
495  }
496  else{
497  RPCGeomServ rpcsrv(rollasociated->id());
498  std::string nameRoll = rpcsrv.name();
499  if(debug) std::cout<<"DT \t \t \t \t \t A roll was ineficient in event "<<iEvent.id().event()<<std::endl;
500  if(debug) ofrej<<"DTs \t Wh "<<dtWheel
501  <<"\t St "<<dtStation
502  <<"\t Se "<<dtSector
503  <<"\t Roll "<<nameRoll
504  <<"\t Event "
505  <<iEvent.id().event()
506  <<"\t Run "
507  <<iEvent.id().run()
508  <<std::endl;
509  }
510  }else{
511  if(debug) std::cout<<"DT \t \t \t \t No the prediction is outside of this roll"<<std::endl;
512  }//Condition for the right match
513  }else{
514  if(debug) std::cout<<"DT \t \t \t No, Exrtrapolation too long!, canceled"<<std::endl;
515  }//D so big
516  }//loop over all the rolls asociated
517  }//Is the segment 4D?
518  }else {
519  if(debug) std::cout<<"DT \t \t More than one segment in this chamber, or we are in Station 4"<<std::endl;
520  }
521  }
522  } else {
523  if(debug) std::cout<<"DT This Event doesn't have any DT4DDSegment"<<std::endl; //is ther more than 1 segment in this event?
524  }
525  }
526  }
527 
528  if(incldtMB4){
529  if(debug) std::cout <<"MB4 \t Getting ALL the DT Segments"<<std::endl;
531  iEvent.getByLabel(dt4DSegments, all4DSegments);
532 
533  iEvent.getByLabel(dt4DSegments, all4DSegments);
534 
535  if(all4DSegments.isValid()){
536  if(all4DSegments->size()>0){
537  std::map<DTChamberId,int> DTSegmentCounter;
539 
540  for (segment = all4DSegments->begin();segment!=all4DSegments->end(); ++segment){
541  DTSegmentCounter[segment->chamberId()]++;
542  }
543 
544  if(debug) std::cout<<"MB4 \t \t Loop Over all4DSegments"<<std::endl;
545  for (segment = all4DSegments->begin(); segment != all4DSegments->end(); ++segment){
546 
547  DTChamberId DTId = segment->chamberId();
548 
549  if(debug) std::cout<<"MB4 \t \t This Segment is in Chamber id: "<<DTId<<std::endl;
550  if(debug) std::cout<<"MB4 \t \t Number of segments in this DT = "<<DTSegmentCounter[DTId]<<std::endl;
551  if(debug) std::cout<<"MB4 \t \t \t Is the only one in this DT? and is in the Station 4?"<<std::endl;
552 
553  if(DTSegmentCounter[DTId] == 1 && DTId.station()==4){
554 
555  if(debug) std::cout<<"MB4 \t \t \t yes"<<std::endl;
556  int dtWheel = DTId.wheel();
557  int dtStation = DTId.station();
558  int dtSector = DTId.sector();
559 
560  LocalPoint segmentPosition= segment->localPosition();
561  LocalVector segmentDirection=segment->localDirection();
562 
563  //check if the dimension of the segment is 2 and the station is 4
564 
565 
566  if(debug) std::cout<<"MB4 \t \t \t \t The Segment in MB4 is 2D?"<<std::endl;
567  if(segment->dimension()==2){
568  if(debug) std::cout<<"MB4 \t \t \t \t yes"<<std::endl;
569  LocalVector segmentDirectionMB4=segmentDirection;
570  LocalPoint segmentPositionMB4=segmentPosition;
571 
572  bool compatiblesegments=false;
573 
574  const BoundPlane& DTSurface4 = dtGeo->idToDet(DTId)->surface();
575 
577 
578  if(debug) std::cout<<"MB4 \t \t \t \t Loop on segments in =sector && MB3 && adjacent sectors && y dim=4"<<std::endl;
579  for(segMB3=all4DSegments->begin();segMB3!=all4DSegments->end();++segMB3){
580 
581  DTChamberId dtid3 = segMB3->chamberId();
582 
583  if(distsector(dtid3.sector(),DTId.sector())<=1
584  && dtid3.station()==3
585  && dtid3.wheel()==DTId.wheel()
586  && DTSegmentCounter[dtid3] == 1
587  && segMB3->dimension()==4){
588 
589  if(debug) std::cout<<"MB4 \t \t \t \t distsector ="<<distsector(dtid3.sector(),DTId.sector())<<std::endl;
590 
591  const GeomDet* gdet3=dtGeo->idToDet(segMB3->geographicalId());
592  const BoundPlane & DTSurface3 = gdet3->surface();
593 
594  LocalVector segmentDirectionMB3 = segMB3->localDirection();
595  GlobalPoint segmentPositionMB3inGlobal = DTSurface3.toGlobal(segMB3->localPosition());
596 
597 
598  LocalVector segDirMB4inMB3Frame=DTSurface3.toLocal(DTSurface4.toGlobal(segmentDirectionMB4));
599  LocalVector segDirMB3inMB4Frame=DTSurface4.toLocal(DTSurface3.toGlobal(segmentDirectionMB3));
600 
601  GlobalVector segDirMB4inGlobalFrame=DTSurface4.toGlobal(segmentDirectionMB4);
602  GlobalVector segDirMB3inGlobalFrame=DTSurface3.toGlobal(segmentDirectionMB3);
603 
604  float dx=segDirMB4inGlobalFrame.x();
605  float dy=segDirMB4inGlobalFrame.y();
606  float dz=segDirMB4inGlobalFrame.z();
607 
608  float dx3=segDirMB3inGlobalFrame.x();
609  float dy3=segDirMB3inGlobalFrame.y();
610  float dz3=segDirMB3inGlobalFrame.z();
611 
612  double cosAng=fabs(dx*dx3+dy*dy3/sqrt((dx3*dx3+dy3*dy3)*(dx*dx+dy*dy)));
613 
614  if(debug) std::cout<<"MB4 \t \t \t \t cosAng"<<cosAng<<"Beetween "<<dtid3<<" and "<<DTId<<std::endl;
615 
616  if(fabs(cosAng)>1.){
617  if(debug) std::cout<<"dx="<<dx<<" dz="<<dz<<std::endl;
618  if(debug) std::cout<<"dx3="<<dx3<<" dz3="<<dz<<std::endl;
619  if(debug) std::cout<<cosAng<<std::endl;
620  }
621 
622  if(cosAng>MinCosAng){
623  compatiblesegments=true;
624  if(dtSector==13){
625  dtSector=4;
626  }
627  if(dtSector==14){
628  dtSector=10;
629  }
630 
631  std::set<RPCDetId> rollsForThisDT = rollstoreDT[DTStationIndex(0,dtWheel,dtSector,dtStation)]; //It should be always 4
632 
633  if(debug) std::cout<<"MB4 \t \t Number of rolls for this DT = "<<rollsForThisDT.size()<<std::endl;
634 
635  assert(rollsForThisDT.size()>=1);
636 
637  if(debug) std::cout<<"MB4 \t \t Loop over all the rolls asociated to this DT"<<std::endl;
638 
639  for (std::set<RPCDetId>::iterator iteraRoll=rollsForThisDT.begin();iteraRoll != rollsForThisDT.end(); iteraRoll++){
640  const RPCRoll* rollasociated = rpcGeo->roll(*iteraRoll); //roll asociado a MB4
641  RPCDetId rpcId = rollasociated->id();
642  const BoundPlane & RPCSurfaceRB4 = rollasociated->surface(); //surface MB4
643 
644  RPCGeomServ rpcsrv(rpcId);
645  std::string nameRoll = rpcsrv.name();
646 
647  if(debug) std::cout<<"MB4 \t \t \t RollName: "<<nameRoll<<std::endl;
648  if(debug) std::cout<<"MB4 \t \t \t Doing the extrapolation to this roll"<<std::endl;
649 
650  GlobalPoint CenterPointRollGlobal=RPCSurfaceRB4.toGlobal(LocalPoint(0,0,0));
651  LocalPoint CenterRollinMB4Frame = DTSurface4.toLocal(CenterPointRollGlobal); //In MB4
652  LocalPoint segmentPositionMB3inMB4Frame = DTSurface4.toLocal(segmentPositionMB3inGlobal); //In MB4
653  LocalPoint segmentPositionMB3inRB4Frame = RPCSurfaceRB4.toLocal(segmentPositionMB3inGlobal); //In MB4
654  LocalVector segmentDirectionMB3inMB4Frame = DTSurface4.toLocal(segDirMB3inGlobalFrame); //In MB4
655 
656  //The exptrapolation is done in MB4 frame. for local x and z is done from MB4,
657  float Dxz=CenterRollinMB4Frame.z();
658  float Xo4=segmentPositionMB4.x();
659  float dxl=segmentDirectionMB4.x(); //dx local for MB4 segment in MB4 Frame
660  float dzl=segmentDirectionMB4.z(); //dx local for MB4 segment in MB4 Frame
661 
662  float X=Xo4+dxl*Dxz/dzl; //In MB4 frame
663  float Z=Dxz;//In MB4 frame
664 
665  //for local y is done from MB3
666  float Yo34=segmentPositionMB3inMB4Frame.y();
667  float dy34 = segmentDirectionMB3inMB4Frame.y();
668  float dz34 = segmentDirectionMB3inMB4Frame.z();
669  float Dy=Dxz-(segmentPositionMB3inMB4Frame.z()); //Distance beetween the segment in MB3 and the RB4 surface
670 
671  if(debug) std::cout<<"MB4 \t \t \t The distance to extrapolate in Y from MB3 is "<<Dy<<"cm"<<std::endl;
672 
673  float Y=Yo34+dy34*Dy/dz34;//In MB4 Frame
674 
675  const RectangularStripTopology* top_
676  =dynamic_cast<const RectangularStripTopology*>(&(rollasociated->topology())); //Topology roll asociated MB4
677  LocalPoint xmin = top_->localPosition(0.);
678  LocalPoint xmax = top_->localPosition((float)rollasociated->nstrips());
679  float rsize = fabs( xmax.x()-xmin.x() );
680  float stripl = top_->stripLength();
681  float stripw = top_->pitch();
682 
683 
684  if(debug) std::cout<<"MB4 \t \t \t Strip Lenght "<<stripl<<"cm"<<std::endl;
685  if(debug) std::cout<<"MB4 \t \t \t Strip Width "<<stripw<<"cm"<<std::endl;
686 
687  if(debug) std::cout<<"MB4 \t \t \t X Predicted in MB4DTLocal= "<<X<<"cm"<<std::endl;
688  if(debug) std::cout<<"MB4 \t \t \t Y Predicted in MB4DTLocal= "<<Y<<"cm"<<std::endl;
689  if(debug) std::cout<<"MB4 \t \t \t Z Predicted in MB4DTLocal= "<<Z<<"cm"<<std::endl;
690 
691  float extrapolatedDistance = sqrt((Y-Yo34)*(Y-Yo34)+Dy*Dy);
692 
693  if(debug) std::cout<<"MB4 \t \t \t segmentPositionMB3inMB4Frame"<<segmentPositionMB3inMB4Frame<<std::endl;
694  if(debug) std::cout<<"MB4 \t \t \t segmentPositionMB4inMB4Frame"<<segmentPosition<<std::endl;
695 
696  if(debug) std::cout<<"MB4 \t \t \t segmentDirMB3inMB4Frame"<<segDirMB3inMB4Frame<<std::endl;
697  if(debug) std::cout<<"MB4 \t \t \t segmentDirMB4inMB4Frame"<<segmentDirectionMB4<<std::endl;
698 
699  if(debug) std::cout<<"MB4 \t \t \t CenterRB4PositioninMB4Frame"<<CenterRollinMB4Frame<<std::endl;
700 
701  if(debug) std::cout<<"MB4 \t \t \t Is the extrapolation distance ="<<extrapolatedDistance<<"less than "<<MaxDrb4<<std::endl;
702 
703 
704  if(extrapolatedDistance<=MaxDrb4){
705  if(debug) std::cout<<"MB4 \t \t \t yes"<<std::endl;
706 
707  GlobalPoint GlobalPointExtrapolated = DTSurface4.toGlobal(LocalPoint(X,Y,Z));
708 
709  if(debug) std::cout<<"MB4 \t \t \t Point ExtraPolated in Global"<<GlobalPointExtrapolated<< std::endl;
710 
711  LocalPoint PointExtrapolatedRPCFrame = RPCSurfaceRB4.toLocal(GlobalPointExtrapolated);
712 
713  if(debug) std::cout<<"MB4 \t \t \t Point Extrapolated in RPCLocal"<<PointExtrapolatedRPCFrame<< std::endl;
714  if(debug) std::cout<<"MB4 \t \t \t Corner of the Roll = ("<<rsize*0.5<<","<<stripl*0.5<<")"<<std::endl;
715  if(debug) std::cout<<"MB4 \t \t \t Info About the Point Extrapolated in X Abs ("<<fabs(PointExtrapolatedRPCFrame.x())<<","
716  <<fabs(PointExtrapolatedRPCFrame.y())<<","<<fabs(PointExtrapolatedRPCFrame.z())<<")"<<std::endl;
717 
718  if(debug) std::cout<<"MB4 \t \t \t Does the extrapolation go inside this roll?"<<std::endl;
719 
720  if(fabs(PointExtrapolatedRPCFrame.z()) < 5. &&
721  fabs(PointExtrapolatedRPCFrame.x()) < rsize*0.5 &&
722  fabs(PointExtrapolatedRPCFrame.y()) < stripl*0.5){
723 
724  if(debug) std::cout<<"MB4 \t \t \t \t yes"<<std::endl;
725 
726  RPCDetId rollId = rollasociated->id();
727 
728  RPCGeomServ rpcsrv(rollId);
729  std::string nameRoll = rpcsrv.name();
730  if(debug) std::cout<<"MB4 \t \t \t \t \t The RPCName is "<<nameRoll<<std::endl;
731  const float stripPredicted=
732  rollasociated->strip(LocalPoint(PointExtrapolatedRPCFrame.x(),PointExtrapolatedRPCFrame.y(),0.));
733 
734  if(debug) std::cout<<"MB4 \t \t \t \t Candidate (from DT Segment) STRIP---> "<<stripPredicted<< std::endl;
735  //--------- HISTOGRAM STRIP PREDICTED FROM DT MB4 -------------------
736 
737  std::map<std::string, MonitorElement*> meMap=meCollection[rollId.rawId()];
738 
739  if(debug) std::cout<<"MB4 \t \t \t \t \t Filling Expected"<<std::endl;
740  sprintf(meIdDT,"ExpectedOccupancyFromDT_%d",rollId.rawId());
741  meMap[meIdDT]->Fill(stripPredicted);
742  //-------------------------------------------------
743 
744 
745  //-------RecHitPart Just For Residual--------
746  int countRecHits = 0;
747  int cluSize = 0;
748  float minres = 3000.;
749 
750  if(debug) std::cout<<"MB4 \t \t \t \t Getting RecHits in Roll Asociated"<<std::endl;
751  typedef std::pair<RPCRecHitCollection::const_iterator, RPCRecHitCollection::const_iterator> rangeRecHits;
752  rangeRecHits recHitCollection = rpcHits->get(rollasociated->id());
754 
755  for (recHit = recHitCollection.first; recHit != recHitCollection.second ; recHit++) {
756  countRecHits++;
757  LocalPoint recHitPos=recHit->localPosition();
758  float res=PointExtrapolatedRPCFrame.x()- recHitPos.x();
759  if(debug) std::cout<<"DT \t \t \t \t \t Found Rec Hit at "<<res<<"cm of the prediction."<<std::endl;
760  if(fabs(res)<fabs(minres)){
761  minres=res;
762  cluSize = recHit->clusterSize();
763  }
764  }
765 
766  bool anycoincidence=false;
767 
768  if(countRecHits==0){
769  if(debug) std::cout <<"MB4 \t \t \t \t \t \t THIS ROLL DOESN'T HAVE ANY RECHIT"<<std::endl;
770  }else{
771  assert(minres!=3000);
772 
773  if(debug) std::cout<<"MB4 \t \t \t \t \t \t PointExtrapolatedRPCFrame.x="<<PointExtrapolatedRPCFrame.x()<<" Minimal Residual ="<<minres<<std::endl;
774  if(debug) std::cout<<"MB4 \t \t \t \t \t \t Minimal Residual less than stripw*rangestrips? minres="<<minres<<" range="<<rangestrips<<" stripw="<<stripw<<" cluSize"<<cluSize<<" <=compare minres with"<<(rangestrips+cluSize*0.5)*stripw<<std::endl;
775  if(fabs(minres)<=(rangestrips+cluSize*0.5)*stripw){
776  if(debug) std::cout<<"MB4 \t \t \t \t \t \t \t True!"<<std::endl;
777  anycoincidence=true;
778  }
779  }
780  if(anycoincidence){
781  if(debug) std::cout<<"MB4 \t \t \t \t \t At least one RecHit inside the range, Predicted="<<stripPredicted<<" minres="<<minres<<"cm range="<<rangestrips<<"strips stripw="<<stripw<<"cm"<<std::endl;
782  if(debug) std::cout<<"MB4 \t \t \t \t \t Norm of Cosine Directors="<<dx3*dx3+dy3*dy3+dz3*dz3<<"~1?"<<std::endl;
783 
784  float cosal = dx/sqrt(dx*dx+dz*dz);
785  if(debug) std::cout<<"MB4 \t \t \t \t \t Angle="<<acos(cosal)*180/3.1415926<<" degree"<<std::endl;
786  if(debug) std::cout<<"MB4 \t \t \t \t \t Filling the Residuals Histogram for globals with "<<minres<<"And the angular incidence with Cos Theta="<<-1*dz<<std::endl;
787  assert(rollId.station()==4);
788  if(cluSize==1*dupli){ hGlobalResClu1La6->Fill(minres);}
789  else if(cluSize==2*dupli){ hGlobalResClu2La6->Fill(minres);}
790  else if(cluSize==3*dupli){ hGlobalResClu3La6->Fill(minres);}
791 
792  sprintf(meIdRPC,"RPCDataOccupancyFromDT_%d",rollId.rawId());
793  if(debug) std::cout<<"MB4 \t \t \t \t \t \t COINCIDENCE!!! Event="<<iEvent.id()<<"Filling RPC Data Occupancy for "<<meIdRPC<<" with "<<stripPredicted<<std::endl;
794  meMap[meIdRPC]->Fill(stripPredicted);
795  }
796  else{
797  RPCGeomServ rpcsrv(rollasociated->id());
798  std::string nameRoll = rpcsrv.name();
799  if(debug) std::cout<<"MB4 \t \t \t \t \t \t A roll was ineficient in event"<<iEvent.id().event()<<std::endl;
800  if(debug) ofrej<<"MB4 \t Wh "<<dtWheel
801  <<"\t St "<<dtStation
802  <<"\t Se "<<dtSector
803  <<"\t Roll "<<nameRoll
804  <<"\t Event "
805  <<iEvent.id().event()
806  <<"\t Run "
807  <<iEvent.id().run()
808  <<std::endl;
809  }
810  }else{
811  if(debug) std::cout<<"MB4 \t \t \t \t No the prediction is outside of this roll"<<std::endl;
812  }
813  }//Condition for the right match
814  else{
815  if(debug) std::cout<<"MB4 \t \t \t No, Exrtrapolation too long!, canceled"<<std::endl;
816  }
817  }//loop over all the rollsasociated
818  }else{
819  compatiblesegments=false;
820  if(debug) std::cout<<"MB4 \t \t \t \t I found segments in MB4 and MB3 adjacent or same wheel and sector but not compatibles Diferent Directions"<<std::endl;
821  }
822  }else{//if dtid3.station()==3&&dtid3.sector()==DTId.sector()&&dtid3.wheel()==DTId.wheel()&&segMB3->dim()==4
823  if(debug) std::cout<<"MB4 \t \t \t No the same station or same wheel or segment dim in mb3 not 4D"<<std::endl;
824  }
825  }//loop over all the segments looking for one in MB3
826  }else{
827  if(debug) std::cout<<"MB4 \t \t \t Is NOT a 2D Segment"<<std::endl;
828  }
829  }else{
830  if(debug) std::cout<<"MB4 \t \t \t \t There is not just one segment or is not in station 4"<<std::endl;
831  }//De aca para abajo esta en dtpart.inl
832  }
833  }else{
834  if(debug) std::cout<<"MB4 \t This event doesn't have 4D Segment"<<std::endl;
835  }
836  }
837  }
838 
839 
840  if(inclcsc){
841  if(debug) std::cout <<"\t Getting the CSC Segments"<<std::endl;
842  edm::Handle<CSCSegmentCollection> allCSCSegments;
843 
844  iEvent.getByLabel(cscSegments, allCSCSegments);
845 
846  if(allCSCSegments.isValid()){
847  if(allCSCSegments->size()>0){
848  statistics->Fill(18);
849 
850  if(debug) std::cout<<"CSC \t Number of CSC Segments in this event = "<<allCSCSegments->size()<<std::endl;
851 
852  std::map<CSCDetId,int> CSCSegmentsCounter;
854 
855  int segmentsInThisEventInTheEndcap=0;
856 
857  for (segment = allCSCSegments->begin();segment!=allCSCSegments->end(); ++segment){
858  CSCSegmentsCounter[segment->cscDetId()]++;
859  segmentsInThisEventInTheEndcap++;
860  }
861 
862  statistics->Fill(allCSCSegments->size()+18);
863 
864  if(debug) std::cout<<"CSC \t loop over all the CSCSegments "<<std::endl;
865  for (segment = allCSCSegments->begin();segment!=allCSCSegments->end(); ++segment){
866  CSCDetId CSCId = segment->cscDetId();
867 
868  if(debug) std::cout<<"CSC \t \t This Segment is in Chamber id: "<<CSCId<<std::endl;
869  if(debug) std::cout<<"CSC \t \t Number of segments in this CSC = "<<CSCSegmentsCounter[CSCId]<<std::endl;
870  if(debug) std::cout<<"CSC \t \t Is the only one in this CSC? is not ind the ring 1 or station 4? Are there more than 2 segments in the event?"<<std::endl;
871 
872  if(CSCSegmentsCounter[CSCId]==1 && CSCId.station()!=4 && CSCId.ring()!=1 && allCSCSegments->size()>=2){
873  if(debug) std::cout<<"CSC \t \t yes"<<std::endl;
874  int cscEndCap = CSCId.endcap();
875  int cscStation = CSCId.station();
876  int cscRing = CSCId.ring();
877  int cscChamber = CSCId.chamber();
878  int rpcRegion = 1; if(cscEndCap==2) rpcRegion= -1;//Relacion entre las endcaps
879  int rpcRing = cscRing;
880  if(cscRing==4)rpcRing =1;
881  int rpcStation = cscStation;
882  int rpcSegment = CSCId.chamber();
883 
884  LocalPoint segmentPosition= segment->localPosition();
885  LocalVector segmentDirection=segment->localDirection();
886  float dz=segmentDirection.z();
887 
888  if(debug) std::cout<<"CSC \t \t Is a good Segment? dim = 4, 4 <= nRecHits <= 10 Incident angle int range 45 < "<<acos(dz)*180/3.1415926<<" < 135? "<<std::endl;
889 
890  if(segment->dimension()==4 && (segment->nRecHits()<=10 && segment->nRecHits()>=4)&& acos(dz)*180/3.1415926 > 45. && acos(dz)*180/3.1415926 < 160. ){
891 
892  //&& segment->chi2()< ??)Add 3 segmentes in the endcaps???
893 
894  if(debug) std::cout<<"CSC \t \t yes"<<std::endl;
895  if(debug) std::cout<<"CSC \t \t CSC Segment Dimension "<<segment->dimension()<<std::endl;
896 
897  float Xo=segmentPosition.x();
898  float Yo=segmentPosition.y();
899  float Zo=segmentPosition.z();
900  float dx=segmentDirection.x();
901  float dy=segmentDirection.y();
902  float dz=segmentDirection.z();
903 
904 
905  if(debug) std::cout<<"CSC \t \t Getting chamber from Geometry"<<std::endl;
906  const CSCChamber* TheChamber=cscGeo->chamber(CSCId);
907  if(debug) std::cout<<"CSC \t \t Getting ID from Chamber"<<std::endl;
908  const CSCDetId TheId=TheChamber->id();
909  if(debug) std::cout<<"CSC \t \t Printing The Id"<<TheId<<std::endl;
910  std::set<RPCDetId> rollsForThisCSC = rollstoreCSC[CSCStationIndex(rpcRegion,rpcStation,rpcRing,rpcSegment)];
911  if(debug) std::cout<<"CSC \t \t Number of rolls for this CSC = "<<rollsForThisCSC.size()<<std::endl;
912 
913  if(debug) std::cout<<"CSC \t \t Loop over all the rolls asociated to this CSC"<<std::endl;
914 
915  if(rpcRing!=1&&rpcStation!=4){
916 
917  if(rollsForThisCSC.size()==0){
918  if(debug) std::cout<<"CSC Fail for CSCId="<<TheId<<" rpcRegion="<<rpcRegion<<" rpcStation="<<rpcStation<<" rpcRing="<<rpcRing<<" rpcSegment="<<rpcSegment<<std::endl;
919  }
920 
921  assert(rollsForThisCSC.size()>=1);
922 
923  //Loop over all the rolls
924  for (std::set<RPCDetId>::iterator iteraRoll = rollsForThisCSC.begin();iteraRoll != rollsForThisCSC.end(); iteraRoll++){
925  const RPCRoll* rollasociated = rpcGeo->roll(*iteraRoll);
926  RPCDetId rpcId = rollasociated->id();
927 
928  if(debug) std::cout<<"CSC \t \t \t We are in the roll getting the surface"<<rpcId<<std::endl;
929  const BoundPlane & RPCSurface = rollasociated->surface();
930 
931  if(debug) std::cout<<"CSC \t \t \t RollID: "<<rpcId<<std::endl;
932 
933  if(debug) std::cout<<"CSC \t \t \t Doing the extrapolation to this roll"<<std::endl;
934  if(debug) std::cout<<"CSC \t \t \t CSC Segment Direction in CSCLocal "<<segmentDirection<<std::endl;
935  if(debug) std::cout<<"CSC \t \t \t CSC Segment Point in CSCLocal "<<segmentPosition<<std::endl;
936 
937  GlobalPoint CenterPointRollGlobal = RPCSurface.toGlobal(LocalPoint(0,0,0));
938  if(debug) std::cout<<"CSC \t \t \t Center (0,0,0) of the Roll in Global"<<CenterPointRollGlobal<<std::endl;
939  GlobalPoint CenterPointCSCGlobal = TheChamber->toGlobal(LocalPoint(0,0,0));
940  if(debug) std::cout<<"CSC \t \t \t Center (0,0,0) of the CSC in Global"<<CenterPointCSCGlobal<<std::endl;
941  GlobalPoint segmentPositionInGlobal=TheChamber->toGlobal(segmentPosition); //new way to convert to global
942  if(debug) std::cout<<"CSC \t \t \t Segment Position in Global"<<segmentPositionInGlobal<<std::endl;
943  LocalPoint CenterRollinCSCFrame = TheChamber->toLocal(CenterPointRollGlobal);
944 
945  if(debug){//to check CSC RPC phi relation!
946  float rpcphi=0;
947  float cscphi=0;
948 
949  (CenterPointRollGlobal.barePhi()<0)?
950  rpcphi = 2*3.141592+CenterPointRollGlobal.barePhi():rpcphi=CenterPointRollGlobal.barePhi();
951 
952  (CenterPointCSCGlobal.barePhi()<0)?
953  cscphi = 2*3.1415926536+CenterPointCSCGlobal.barePhi():cscphi=CenterPointCSCGlobal.barePhi();
954 
955  float df=fabs(cscphi-rpcphi);
956  float dr=fabs(CenterPointRollGlobal.perp()-CenterPointCSCGlobal.perp());
957  float diffz=CenterPointRollGlobal.z()-CenterPointCSCGlobal.z();
958  float dfg=df*180./3.14159265;
959 
960  if(debug) std::cout<<"CSC \t \t \t z of RPC="<<CenterPointRollGlobal.z()<<"z of CSC"<<CenterPointCSCGlobal.z()<<" dfg="<<dfg<<std::endl;
961 
962 
963  RPCGeomServ rpcsrv(rpcId);
964 
965 
966  if(dr>200.||fabs(dz)>55.||dfg>1.){
967  //if(rpcRegion==1&&dfg>1.&&dr>100.){
968  if (debug) std::cout
969  <<"\t \t \t CSC Station= "<<CSCId.station()
970  <<" Ring= "<<CSCId.ring()
971  <<" Chamber= "<<CSCId.chamber()
972  <<" cscphi="<<cscphi*180/3.14159265
973  <<"\t RPC Station= "<<rpcId.station()
974  <<" ring= "<<rpcId.ring()
975  <<" segment =-> "<<rpcsrv.name()
976  <<" rollphi="<<rpcphi*180/3.14159265
977  <<"\t dfg="<<dfg
978  <<" dz="<<diffz
979  <<" dr="<<dr
980  <<std::endl;
981 
982  }
983  }
984 
985 
986 
987 
988  float D=CenterRollinCSCFrame.z();
989 
990  float X=Xo+dx*D/dz;
991  float Y=Yo+dy*D/dz;
992  float Z=D;
993 
994  const TrapezoidalStripTopology* top_=dynamic_cast<const TrapezoidalStripTopology*>(&(rollasociated->topology()));
995  LocalPoint xmin = top_->localPosition(0.);
996  if(debug) std::cout<<"CSC \t \t \t xmin of this Roll "<<xmin<<"cm"<<std::endl;
997  LocalPoint xmax = top_->localPosition((float)rollasociated->nstrips());
998  if(debug) std::cout<<"CSC \t \t \t xmax of this Roll "<<xmax<<"cm"<<std::endl;
999  float rsize = fabs( xmax.x()-xmin.x() );
1000  if(debug) std::cout<<"CSC \t \t \t Roll Size "<<rsize<<"cm"<<std::endl;
1001  float stripl = top_->stripLength();
1002  float stripw = top_->pitch();
1003 
1004  if(debug) std::cout<<"CSC \t \t \t Strip Lenght "<<stripl<<"cm"<<std::endl;
1005  if(debug) std::cout<<"CSC \t \t \t Strip Width "<<stripw<<"cm"<<std::endl;
1006 
1007  if(debug) std::cout<<"CSC \t \t \t X Predicted in CSCLocal= "<<X<<"cm"<<std::endl;
1008  if(debug) std::cout<<"CSC \t \t \t Y Predicted in CSCLocal= "<<Y<<"cm"<<std::endl;
1009  if(debug) std::cout<<"CSC \t \t \t Z Predicted in CSCLocal= "<<Z<<"cm"<<std::endl;
1010 
1011  float extrapolatedDistance = sqrt((X-Xo)*(X-Xo)+(Y-Yo)*(Y-Yo)+(Z-Zo)*(Z-Zo));
1012 
1013  if(debug) std::cout<<"CSC \t \t \t Is the distance of extrapolation less than MaxD? ="<<extrapolatedDistance<<"cm"<<"MaxD="<<MaxD<<"cm"<<std::endl;
1014 
1015  if(extrapolatedDistance<=MaxD){
1016 
1017  if(debug) std::cout<<"CSC \t \t \t yes"<<std::endl;
1018 
1019  GlobalPoint GlobalPointExtrapolated=TheChamber->toGlobal(LocalPoint(X,Y,Z));
1020  if(debug) std::cout<<"CSC \t \t \t Point ExtraPolated in Global"<<GlobalPointExtrapolated<< std::endl;
1021 
1022 
1023  LocalPoint PointExtrapolatedRPCFrame = RPCSurface.toLocal(GlobalPointExtrapolated);
1024 
1025  if(debug) std::cout<<"CSC \t \t \t Point Extrapolated in RPCLocal"<<PointExtrapolatedRPCFrame<< std::endl;
1026  if(debug) std::cout<<"CSC \t \t \t Corner of the Roll = ("<<rsize*0.5<<","<<stripl*0.5<<")"<<std::endl;
1027  if(debug) std::cout<<"CSC \t \t \t Info About the Point Extrapolated in X Abs ("<<fabs(PointExtrapolatedRPCFrame.x())<<","
1028  <<fabs(PointExtrapolatedRPCFrame.y())<<","<<fabs(PointExtrapolatedRPCFrame.z())<<")"<<std::endl;
1029  if(debug) std::cout<<"CSC \t \t \t dz="
1030  <<fabs(PointExtrapolatedRPCFrame.z())<<" dx="
1031  <<fabs(PointExtrapolatedRPCFrame.x())<<" dy="
1032  <<fabs(PointExtrapolatedRPCFrame.y())<<std::endl;
1033 
1034  if(debug) std::cout<<"CSC \t \t \t Does the extrapolation go inside this roll????"<<std::endl;
1035 
1036  if(fabs(PointExtrapolatedRPCFrame.z()) < 10. &&
1037  fabs(PointExtrapolatedRPCFrame.x()) < rsize*0.5 &&
1038  fabs(PointExtrapolatedRPCFrame.y()) < stripl*0.5){
1039 
1040  if(debug) std::cout<<"CSC \t \t \t \t yes"<<std::endl;
1041 
1042  RPCDetId rollId = rollasociated->id();
1043 
1044  RPCGeomServ rpcsrv(rollId);
1045  std::string nameRoll = rpcsrv.name();
1046  if(debug) std::cout<<"CSC \t \t \t \t The RPCName is "<<nameRoll<<std::endl;
1047 
1048  const float stripPredicted =
1049  rollasociated->strip(LocalPoint(PointExtrapolatedRPCFrame.x(),PointExtrapolatedRPCFrame.y(),0.));
1050 
1051  if(debug) std::cout<<"CSC \t \t \t \t \t Candidate"<<rollId<<" "<<"(from CSC Segment) STRIP---> "<<stripPredicted<< std::endl;
1052  //--------- HISTOGRAM STRIP PREDICTED FROM CSC -------------------
1053 
1054  std::map<std::string, MonitorElement*> meMap=meCollection[rpcId.rawId()];
1055 
1056  if(debug) std::cout<<"CSC \t \t \t \t Filling Expected"<<std::endl;
1057  sprintf(meIdCSC,"ExpectedOccupancyFromCSC_%d",rollId.rawId());
1058  meMap[meIdCSC]->Fill(stripPredicted);
1059  //--------------------------------------------------------------------
1060 
1061 
1062  //-------RecHitPart Just For Residual--------
1063  int cluSize = 0;
1064  int countRecHits = 0;
1065  float minres = 3000.;
1066 
1067  if(debug) std::cout<<"CSC \t \t \t \t \t Getting RecHits in Roll Asociated"<<std::endl;
1068  typedef std::pair<RPCRecHitCollection::const_iterator, RPCRecHitCollection::const_iterator> rangeRecHits;
1069  rangeRecHits recHitCollection = rpcHits->get(rollasociated->id());
1071 
1072  for (recHit = recHitCollection.first; recHit != recHitCollection.second ; recHit++) {
1073 
1074  sprintf(meIdRPC,"BXDistribution_%d",rollasociated->id().rawId());
1075  meMap[meIdRPC]->Fill(recHit->BunchX());
1076 
1077  countRecHits++;
1078  LocalPoint recHitPos=recHit->localPosition();
1079  float res=PointExtrapolatedRPCFrame.x()- recHitPos.x();
1080  if(debug) std::cout<<"CSC \t \t \t \t \t \t Found Rec Hit at "<<res<<"cm of the prediction."<<std::endl;
1081  if(fabs(res)<fabs(minres)){
1082  minres=res;
1083  cluSize = recHit->clusterSize();
1084  if(debug) std::cout<<"CSC \t \t \t \t \t \t \t New Min Res "<<res<<"cm."<<std::endl;
1085  }
1086  }
1087 
1088  bool anycoincidence = false;
1089 
1090  if(countRecHits==0){
1091  if(debug) std::cout <<"CSC \t \t \t \t \t THIS ROLL DOESN'T HAVE ANY RECHIT"<<std::endl;
1092  }else{
1093  assert(minres!=3000);
1094 
1095  if(debug) std::cout<<"CSC \t \t \t \t \t PointExtrapolatedRPCFrame.x="<<PointExtrapolatedRPCFrame.x()<<" Minimal Residual"<<minres<<std::endl;
1096  if(debug) std::cout<<"CSC \t \t \t \t \t Minimal Residual less than stripw*rangestrips? minres="<<minres<<" range="<<rangestrips<<" stripw="<<stripw<<" cluSize"<<cluSize<<" <=compare minres with"<<(rangestrips+cluSize*0.5)*stripw<<std::endl;
1097  if(fabs(minres)<=(rangestrips+cluSize*0.5)*stripw){
1098  if(debug) std::cout<<"CSC \t \t \t \t \t \t True!"<<std::endl;
1099  anycoincidence=true;
1100  }
1101  }
1102  if(anycoincidence){
1103  if(debug) std::cout<<"CSC \t \t \t \t \t At least one RecHit inside the range, Predicted="<<stripPredicted<<" minres="<<minres<<"cm range="<<rangestrips<<"strips stripw="<<stripw<<"cm"<<std::endl;
1104  if(debug) std::cout<<"CSC \t \t \t \t \t Norm of Cosine Directors="<<dx*dx+dy*dy+dz*dz<<"~1?"<<std::endl;
1105 
1106  float cosal = dx/sqrt(dx*dx+dz*dz);
1107  if(debug) std::cout<<"CSC \t \t \t \t \t Angle="<<acos(cosal)*180/3.1415926<<" degree"<<std::endl;
1108  if(debug) std::cout<<"CSC \t \t \t \t \t Filling the Residuals Histogram for globals with "<<minres<<"And the angular incidence with Cos Theta="<<-1*dz<<std::endl;
1109  if(rollId.ring()==2&&rollId.roll()==1){if(cluSize==1*dupli) hGlobalResClu1R2A->Fill(minres); if(cluSize==2*dupli) hGlobalResClu2R2A->Fill(minres); if(cluSize==3*dupli) hGlobalResClu3R2A->Fill(minres);}
1110  if(rollId.ring()==2&&rollId.roll()==2){if(cluSize==1*dupli) hGlobalResClu1R2B->Fill(minres); if(cluSize==2*dupli) hGlobalResClu2R2B->Fill(minres); if(cluSize==3*dupli) hGlobalResClu3R2B->Fill(minres);}
1111  if(rollId.ring()==2&&rollId.roll()==3){if(cluSize==1*dupli) hGlobalResClu1R2C->Fill(minres); if(cluSize==2*dupli) hGlobalResClu2R2C->Fill(minres); if(cluSize==3*dupli) hGlobalResClu3R2C->Fill(minres);}
1112  if(rollId.ring()==3&&rollId.roll()==1){if(cluSize==1*dupli) hGlobalResClu1R3A->Fill(minres); if(cluSize==2*dupli) hGlobalResClu2R3A->Fill(minres); if(cluSize==3*dupli) hGlobalResClu3R3A->Fill(minres);}
1113  if(rollId.ring()==3&&rollId.roll()==2){if(cluSize==1*dupli) hGlobalResClu1R3B->Fill(minres); if(cluSize==2*dupli) hGlobalResClu2R3B->Fill(minres); if(cluSize==3*dupli) hGlobalResClu3R3B->Fill(minres);}
1114  if(rollId.ring()==3&&rollId.roll()==3){if(cluSize==1*dupli) hGlobalResClu1R3C->Fill(minres); if(cluSize==2*dupli) hGlobalResClu2R3C->Fill(minres); if(cluSize==3*dupli) hGlobalResClu3R3C->Fill(minres);}
1115 
1116  sprintf(meIdRPC,"RPCDataOccupancyFromCSC_%d",rollId.rawId());
1117  if(debug) std::cout <<"CSC \t \t \t \t \t \t COINCEDENCE!!! Event="<<iEvent.id()<<"Filling RPC Data Occupancy for "<<meIdRPC<<" with "<<stripPredicted<<std::endl;
1118  meMap[meIdRPC]->Fill(stripPredicted);
1119  }
1120  else{
1121  RPCGeomServ rpcsrv(rollasociated->id());
1122  std::string nameRoll = rpcsrv.name();
1123  if(debug) std::cout<<"CSC \t \t \t \t \t \t A roll was ineficient in event"<<iEvent.id().event()<<std::endl;
1124  if(debug) ofrej<<"CSC \t EndCap "<<rpcRegion
1125  <<"\t cscStation "<<cscStation
1126  <<"\t cscRing "<<cscRing
1127  <<"\t cscChamber "<<cscChamber
1128  <<"\t Roll "<<nameRoll
1129  <<"\t Event "<<iEvent.id().event()
1130  <<"\t CSCId "<<CSCId
1131  <<"\t Event "
1132  <<iEvent.id().event()
1133  <<"\t Run "
1134  <<iEvent.id().run()
1135  <<std::endl;
1136  }
1137  }else{
1138  if(debug) std::cout<<"CSC \t \t \t \t No the prediction is outside of this roll"<<std::endl;
1139  }//Condition for the right match
1140  }else{//if extrapolation distance D is not too long
1141  if(debug) std::cout<<"CSC \t \t \t No, Exrtrapolation too long!, canceled"<<std::endl;
1142  }//D so big
1143  }//loop over the rolls asociated
1144  }//Condition over the startup geometry!!!!
1145  }//Is the segment 4D?
1146  }else{
1147  if(debug) std::cout<<"CSC \t \t More than one segment in this chamber, or we are in Station Ring 1 or in Station 4"<<std::endl;
1148  }
1149  }
1150  }else{
1151  if(debug) std::cout<<"CSC This Event doesn't have any CSCSegment"<<std::endl;
1152  }
1153  }
1154  }
1155  }
1156 }
const double Z[kNumberCalorimeter]
RunNumber_t run() const
Definition: EventID.h:42
int chamber() const
Definition: CSCDetId.h:70
GlobalPoint toGlobal(const Point2DBase< Scalar, LocalTag > lp) const
Definition: Surface.h:78
EventNumber_t event() const
Definition: EventID.h:44
float strip(const LocalPoint &lp) const
Definition: RPCRoll.cc:71
MonitorElement * hGlobalResClu1La3
const Topology & topology() const
Definition: RPCRoll.cc:30
edm::ESHandle< RPCGeometry > rpcGeo
T perp() const
Definition: PV3DBase.h:66
MonitorElement * hGlobalResClu1R2A
virtual float stripLength() const
CSCDetId id() const
Get the (concrete) DetId.
Definition: CSCChamber.h:37
MonitorElement * hGlobalResClu1R3A
GlobalPoint toGlobal(const Local2DPoint &lp) const
Conversion to the global R.F. from the R.F. of the GeomDet.
Definition: GeomDet.h:49
int nstrips() const
Definition: RPCRoll.cc:46
MonitorElement * hGlobalResClu3R2C
T y() const
Definition: PV3DBase.h:57
#define X(str)
Definition: MuonsGrabber.cc:49
MonitorElement * hGlobalResClu3La1
MonitorElement * hGlobalResClu3R3C
MonitorElement * hGlobalResClu2La2
LocalPoint toLocal(const GlobalPoint &gp) const
Conversion to the R.F. of the GeomDet.
Definition: GeomDet.h:64
std::map< int, std::map< std::string, MonitorElement * > > meCollection
std::ofstream ofrej
int distsector(int sector1, int sector2)
void Fill(long long x)
uint32_t rawId() const
get the raw id
Definition: DetId.h:45
int endcap() const
Definition: CSCDetId.h:95
T barePhi() const
Definition: PV3DBase.h:62
C::const_iterator const_iterator
constant access iterator type
Definition: RangeMap.h:45
RPCDetId id() const
Definition: RPCRoll.cc:24
virtual std::string name()
Definition: RPCGeomServ.cc:15
MonitorElement * hGlobalResClu3La3
int roll() const
Definition: RPCDetId.h:122
edm::ESHandle< DTGeometry > dtGeo
MonitorElement * hGlobalResClu1La6
int ring() const
Definition: RPCDetId.h:74
T sqrt(T t)
Definition: SSEVec.h:28
LocalPoint toLocal(const GlobalPoint &gp) const
std::string dt4DSegments
T z() const
Definition: PV3DBase.h:58
MonitorElement * hGlobalResClu3R2A
MonitorElement * hGlobalResClu2La5
MonitorElement * hGlobalResClu1La4
MonitorElement * hGlobalResClu1R3B
MonitorElement * hGlobalResClu1R2C
MonitorElement * hGlobalResClu2R3C
MonitorElement * hGlobalResClu3R3A
bool isValid() const
Definition: HandleBase.h:76
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:359
std::map< CSCStationIndex, std::set< RPCDetId > > rollstoreCSC
MonitorElement * statistics
MonitorElement * hGlobalResClu2La4
std::map< DTStationIndex, std::set< RPCDetId > > rollstoreDT
MonitorElement * hGlobalResClu1La1
edm::ESHandle< CSCGeometry > cscGeo
int ring() const
Definition: CSCDetId.h:77
MonitorElement * hGlobalResClu2La6
int layer() const
Definition: RPCDetId.h:110
MonitorElement * hGlobalResClu2R2A
MonitorElement * hGlobalResClu2R3A
edm::InputTag RPCRecHitLabel_
virtual LocalPoint localPosition(float strip) const
double rangestrips
edm::EventID id() const
Definition: EventBase.h:56
MonitorElement * hGlobalResClu3La2
int sector() const
Definition: DTChamberId.h:63
MonitorElement * hGlobalResClu3La5
MonitorElement * hGlobalResClu2La1
Local3DPoint LocalPoint
Definition: LocalPoint.h:11
MonitorElement * hGlobalResClu2La3
MonitorElement * hGlobalResClu3La6
int station() const
Definition: CSCDetId.h:88
tuple cout
Definition: gather_cfg.py:41
MonitorElement * hGlobalResClu1R3C
MonitorElement * hGlobalResClu2R2B
virtual LocalPoint localPosition(float strip) const
int station() const
Return the station number.
Definition: DTChamberId.h:53
MonitorElement * hGlobalResClu3R3B
int wheel() const
Return the wheel number.
Definition: DTChamberId.h:47
T x() const
Definition: PV3DBase.h:56
virtual float stripLength() const
det heigth (strip length in the middle)
MonitorElement * hGlobalResClu1La5
MonitorElement * hGlobalResClu3R2B
DecomposeProduct< arg, typename Div::arg > D
Definition: Factorize.h:150
virtual const BoundPlane & surface() const
The nominal surface of the GeomDet.
Definition: GeomDet.h:37
std::string cscSegments
MonitorElement * hGlobalResClu2R3B
MonitorElement * hGlobalResClu3La4
MonitorElement * hGlobalResClu1R2B
MonitorElement * hGlobalResClu2R2C
MonitorElement * hGlobalResClu1La2
int station() const
Definition: RPCDetId.h:98
void RPCEfficiency::beginJob ( void  )
virtual

Reimplemented from edm::EDAnalyzer.

Definition at line 31 of file RPCEfficiency.cc.

31  {
32 
33 }
void RPCEfficiency::beginRun ( const edm::Run run,
const edm::EventSetup iSetup 
)
virtual

Reimplemented from edm::EDAnalyzer.

Definition at line 140 of file RPCEfficiency.cc.

References bookDetUnitSeg(), gather_cfg::cout, cscGeo, debug, dtGeo, folderPath, edm::EventSetup::get(), inclcsc, incldt, incldtMB4, meCollection, RPCGeomServ::name(), csvReporter::r, DetId::rawId(), RPCDetId::region(), relativeConstraints::ring, RPCDetId::ring(), RPCChamber::rolls(), rollstoreCSC, rollstoreDT, rpcGeo, RPCDetId::sector(), RPCGeomServ::segment(), relativeConstraints::station, and RPCDetId::station().

140  {
141 
142  iSetup.get<MuonGeometryRecord>().get(rpcGeo);
143  iSetup.get<MuonGeometryRecord>().get(dtGeo);
144  iSetup.get<MuonGeometryRecord>().get(cscGeo);
145 
146  for (TrackingGeometry::DetContainer::const_iterator it=rpcGeo->dets().begin();it<rpcGeo->dets().end();it++){
147  if(dynamic_cast< RPCChamber* >( *it ) != 0 ){
148  RPCChamber* ch = dynamic_cast< RPCChamber* >( *it );
149  std::vector< const RPCRoll*> roles = (ch->rolls());
150  for(std::vector<const RPCRoll*>::const_iterator r = roles.begin();r != roles.end(); ++r){
151  RPCDetId rpcId = (*r)->id();
152  int region=rpcId.region();
153  //booking all histograms
154  RPCGeomServ rpcsrv(rpcId);
155  std::string nameRoll = rpcsrv.name();
156  if(debug) std::cout<<"Booking for "<<rpcId.rawId()<<std::endl;
157  meCollection[rpcId.rawId()] = bookDetUnitSeg(rpcId,(*r)->nstrips(),folderPath+"MuonSegEff/");
158 
159  if(region==0&&(incldt||incldtMB4)){
160  //std::cout<<"--Filling the dtstore"<<rpcId<<std::endl;
161  int wheel=rpcId.ring();
162  int sector=rpcId.sector();
163  int station=rpcId.station();
164  DTStationIndex ind(region,wheel,sector,station);
165  std::set<RPCDetId> myrolls;
166  if (rollstoreDT.find(ind)!=rollstoreDT.end()) myrolls=rollstoreDT[ind];
167  myrolls.insert(rpcId);
168  rollstoreDT[ind]=myrolls;
169 
170  }
171  if(region!=0 && inclcsc){
172  int region=rpcId.region();
173  int station=rpcId.station();
174  int ring=rpcId.ring();
175  int cscring=ring;
176  int cscstation=station;
177  RPCGeomServ rpcsrv(rpcId);
178  int rpcsegment = rpcsrv.segment();
179  int cscchamber = rpcsegment;
180  if((station==2||station==3)&&ring==3){
181  cscring = 2;
182  }
183 
184  CSCStationIndex ind(region,cscstation,cscring,cscchamber);
185  std::set<RPCDetId> myrolls;
186  if (rollstoreCSC.find(ind)!=rollstoreCSC.end()){
187  myrolls=rollstoreCSC[ind];
188  }
189  myrolls.insert(rpcId);
190  rollstoreCSC[ind]=myrolls;
191  }
192  }
193  }
194  }
195  for (TrackingGeometry::DetContainer::const_iterator it=rpcGeo->dets().begin();it<rpcGeo->dets().end();it++){
196  if( dynamic_cast< RPCChamber* >( *it ) != 0 ){
197 
198  RPCChamber* ch = dynamic_cast< RPCChamber* >( *it );
199  std::vector< const RPCRoll*> roles = (ch->rolls());
200  for(std::vector<const RPCRoll*>::const_iterator r = roles.begin();r != roles.end(); ++r){
201  RPCDetId rpcId = (*r)->id();
202 
203  int region=rpcId.region();
204 
205  /*if(region==0&&(incldt||incldtMB4)&&rpcId.ring()!=0&&rpcId.station()!=4){
206  //std::cout<<"--Filling the dtstore for statistics"<<rpcId<<std::endl;
207 
208  int sidewheel = 0;
209 
210  if(rpcId.ring()==-2){
211  sidewheel=-1;
212  }
213  else if(rpcId.ring()==-1){
214  sidewheel=0;
215  }
216  else if(rpcId.ring()==1){
217  sidewheel=0;
218  }
219  else if(rpcId.ring()==2){
220  sidewheel=1;
221  }
222  int wheel= sidewheel;
223  int sector=rpcId.sector();
224  int station=rpcId.station();
225  DTStationIndex ind(region,wheel,sector,station);
226  std::set<RPCDetId> myrolls;
227  if (rollstoreDT.find(ind)!=rollstoreDT.end()) myrolls=rollstoreDT[ind];
228  myrolls.insert(rpcId);
229  rollstoreDT[ind]=myrolls;
230  }*/
231 
232  if(region!=0 && inclcsc && (rpcId.ring()==2 || rpcId.ring()==3)){
233  int region=rpcId.region();
234  int station=rpcId.station();
235  int ring=rpcId.ring();
236  int cscring = ring;
237 
238  if((station==2||station==3)&&ring==3) cscring = 2; //CSC Ring 2 covers rpc ring 2 & 3
239 
240 
241  int cscstation=station;
242  RPCGeomServ rpcsrv(rpcId);
243  int rpcsegment = rpcsrv.segment();
244 
245 
246  int cscchamber = rpcsegment+1;
247  if(cscchamber==37)cscchamber=1;
248  CSCStationIndex ind(region,cscstation,cscring,cscchamber);
249  std::set<RPCDetId> myrolls;
250  if (rollstoreCSC.find(ind)!=rollstoreCSC.end())myrolls=rollstoreCSC[ind];
251  myrolls.insert(rpcId);
252  rollstoreCSC[ind]=myrolls;
253 
254  cscchamber = rpcsegment-1;
255  if(cscchamber==0)cscchamber=36;
256  CSCStationIndex indDos(region,cscstation,cscring,cscchamber);
257  std::set<RPCDetId> myrollsDos;
258  if (rollstoreCSC.find(indDos)!=rollstoreCSC.end()) myrollsDos=rollstoreCSC[indDos];
259  myrollsDos.insert(rpcId);
260  rollstoreCSC[indDos]=myrollsDos;
261  }
262  }
263  }
264  }
265 }//beginRun
edm::ESHandle< RPCGeometry > rpcGeo
std::map< std::string, MonitorElement * > bookDetUnitSeg(RPCDetId &detId, int nstrips, std::string folder)
std::map< int, std::map< std::string, MonitorElement * > > meCollection
uint32_t rawId() const
get the raw id
Definition: DetId.h:45
edm::ESHandle< DTGeometry > dtGeo
int ring() const
Definition: RPCDetId.h:74
std::string folderPath
const std::vector< const RPCRoll * > & rolls() const
Return the Rolls.
Definition: RPCChamber.cc:70
std::map< CSCStationIndex, std::set< RPCDetId > > rollstoreCSC
std::map< DTStationIndex, std::set< RPCDetId > > rollstoreDT
edm::ESHandle< CSCGeometry > cscGeo
const T & get() const
Definition: EventSetup.h:55
int sector() const
Sector id: the group of chambers at same phi (and increasing r)
Definition: RPCDetId.h:104
tuple cout
Definition: gather_cfg.py:41
int region() const
Region id: 0 for Barrel, +/-1 For +/- Endcap.
Definition: RPCDetId.h:65
int station() const
Definition: RPCDetId.h:98
std::map< std::string, MonitorElement * > RPCEfficiency::bookDetUnitSeg ( RPCDetId detId,
int  nstrips,
std::string  folder 
)

Definition at line 13 of file RPCEfficiencyBook.cc.

References DQMStore::book1D(), dbe, DetId::rawId(), RPCDetId::region(), and DQMStore::setCurrentFolder().

Referenced by beginRun().

13  {
14 
15  std::map<std::string, MonitorElement*> meMap;
16 
17  dbe->setCurrentFolder(folder);
18 
19  char meId [128];
20  char meTitle [128];
21 
22  int rawId = detId.rawId();
23 
24  //Begin booking DT
25  if(detId.region()==0) {
26 
27  sprintf(meId,"ExpectedOccupancyFromDT_%d",rawId);
28  sprintf(meTitle,"ExpectedOccupancyFromDT_for_%d",rawId);
29  meMap[meId] = dbe->book1D(meId, meTitle, nstrips, 0.5, nstrips+0.5);
30 
31  sprintf(meId,"RPCDataOccupancyFromDT_%d",rawId);
32  sprintf(meTitle,"RPCDataOccupancyFromDT_for_%d",rawId);
33  meMap[meId] = dbe->book1D(meId, meTitle, nstrips, 0.5, nstrips+0.5);
34 
35  sprintf(meId,"BXDistribution_%d",rawId);
36  sprintf(meTitle,"BXDistribution_for_%d",rawId);
37  meMap[meId] = dbe->book1D(meId, meTitle, 11,-5.5, 5.5);
38  }else{
39  //std::cout<<"Booking for the EndCap"<<detUnitLabel<<std::endl;
40 
41  sprintf(meId,"ExpectedOccupancyFromCSC_%d",rawId);
42  sprintf(meTitle,"ExpectedOccupancyFromCSC_for_%d",rawId);
43  meMap[meId] = dbe->book1D(meId, meTitle, nstrips, 0.5, nstrips+0.5);
44 
45  sprintf(meId,"RPCDataOccupancyFromCSC_%d",rawId);
46  sprintf(meTitle,"RPCDataOccupancyFromCSC_for_%d",rawId);
47  meMap[meId] = dbe->book1D(meId, meTitle, nstrips, 0.5, nstrips+0.5);
48 
49  sprintf(meId,"BXDistribution_%d",rawId);
50  sprintf(meTitle,"BXDistribution_for_%d",rawId);
51  meMap[meId] = dbe->book1D(meId, meTitle, 11,-5.5, 5.5);
52  }
53  return meMap;
54 }
MonitorElement * book1D(const char *name, const char *title, int nchX, double lowX, double highX)
Book 1D histogram.
Definition: DQMStore.cc:519
uint32_t rawId() const
get the raw id
Definition: DetId.h:45
DQMStore * dbe
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:237
int region() const
Region id: 0 for Barrel, +/-1 For +/- Endcap.
Definition: RPCDetId.h:65
void RPCEfficiency::endJob ( void  )
virtual

Reimplemented from edm::EDAnalyzer.

Definition at line 1166 of file RPCEfficiency.cc.

References dbe.

1166  {
1167  dbe =0;
1168 }
DQMStore * dbe
void RPCEfficiency::endRun ( const edm::Run r,
const edm::EventSetup iSetup 
)
virtual

Reimplemented from edm::EDAnalyzer.

Definition at line 1159 of file RPCEfficiency.cc.

References dbe, EffRootFileName, EffSaveRootFile, and DQMStore::save().

1159  {
1160  if (EffSaveRootFile){
1162  }
1163 }
void save(const std::string &filename, const std::string &path="", const std::string &pattern="", const std::string &rewrite="", SaveReferenceTag ref=SaveWithReference, int minStatus=dqm::qstatus::STATUS_OK, const std::string &fileupdate="RECREATE")
Definition: DQMStore.cc:1883
DQMStore * dbe
std::string EffRootFileName

Member Data Documentation

MonitorElement* RPCEfficiency::AngClu1La1

Definition at line 145 of file RPCEfficiency.h.

MonitorElement* RPCEfficiency::AngClu1La2

Definition at line 146 of file RPCEfficiency.h.

MonitorElement* RPCEfficiency::AngClu1La3

Definition at line 147 of file RPCEfficiency.h.

MonitorElement* RPCEfficiency::AngClu1La4

Definition at line 148 of file RPCEfficiency.h.

MonitorElement* RPCEfficiency::AngClu1La5

Definition at line 149 of file RPCEfficiency.h.

MonitorElement* RPCEfficiency::AngClu1La6

Definition at line 150 of file RPCEfficiency.h.

MonitorElement* RPCEfficiency::AngClu2La1

Definition at line 152 of file RPCEfficiency.h.

MonitorElement* RPCEfficiency::AngClu2La2

Definition at line 153 of file RPCEfficiency.h.

MonitorElement* RPCEfficiency::AngClu2La3

Definition at line 154 of file RPCEfficiency.h.

MonitorElement* RPCEfficiency::AngClu2La4

Definition at line 155 of file RPCEfficiency.h.

MonitorElement* RPCEfficiency::AngClu2La5

Definition at line 156 of file RPCEfficiency.h.

MonitorElement* RPCEfficiency::AngClu2La6

Definition at line 157 of file RPCEfficiency.h.

MonitorElement* RPCEfficiency::AngClu3La1

Definition at line 159 of file RPCEfficiency.h.

MonitorElement* RPCEfficiency::AngClu3La2

Definition at line 160 of file RPCEfficiency.h.

MonitorElement* RPCEfficiency::AngClu3La3

Definition at line 161 of file RPCEfficiency.h.

MonitorElement* RPCEfficiency::AngClu3La4

Definition at line 162 of file RPCEfficiency.h.

MonitorElement* RPCEfficiency::AngClu3La5

Definition at line 163 of file RPCEfficiency.h.

MonitorElement* RPCEfficiency::AngClu3La6

Definition at line 164 of file RPCEfficiency.h.

std::vector<std::map<RPCDetId, int> > RPCEfficiency::counter
private

Definition at line 212 of file RPCEfficiency.h.

edm::ESHandle<CSCGeometry> RPCEfficiency::cscGeo

Definition at line 118 of file RPCEfficiency.h.

Referenced by analyze(), and beginRun().

std::string RPCEfficiency::cscSegments
private

Definition at line 228 of file RPCEfficiency.h.

Referenced by analyze(), and RPCEfficiency().

DQMStore* RPCEfficiency::dbe
private

Definition at line 240 of file RPCEfficiency.h.

Referenced by bookDetUnitSeg(), endJob(), endRun(), and RPCEfficiency().

bool RPCEfficiency::debug
private

Definition at line 218 of file RPCEfficiency.h.

Referenced by analyze(), beginRun(), and RPCEfficiency().

MonitorElement* RPCEfficiency::DistBorderClu1La1

Definition at line 123 of file RPCEfficiency.h.

MonitorElement* RPCEfficiency::DistBorderClu1La2

Definition at line 124 of file RPCEfficiency.h.

MonitorElement* RPCEfficiency::DistBorderClu1La3

Definition at line 125 of file RPCEfficiency.h.

MonitorElement* RPCEfficiency::DistBorderClu1La4

Definition at line 126 of file RPCEfficiency.h.

MonitorElement* RPCEfficiency::DistBorderClu1La5

Definition at line 127 of file RPCEfficiency.h.

MonitorElement* RPCEfficiency::DistBorderClu1La6

Definition at line 128 of file RPCEfficiency.h.

MonitorElement* RPCEfficiency::DistBorderClu2La1

Definition at line 130 of file RPCEfficiency.h.

MonitorElement* RPCEfficiency::DistBorderClu2La2

Definition at line 131 of file RPCEfficiency.h.

MonitorElement* RPCEfficiency::DistBorderClu2La3

Definition at line 132 of file RPCEfficiency.h.

MonitorElement* RPCEfficiency::DistBorderClu2La4

Definition at line 133 of file RPCEfficiency.h.

MonitorElement* RPCEfficiency::DistBorderClu2La5

Definition at line 134 of file RPCEfficiency.h.

MonitorElement* RPCEfficiency::DistBorderClu2La6

Definition at line 135 of file RPCEfficiency.h.

MonitorElement* RPCEfficiency::DistBorderClu3La1

Definition at line 137 of file RPCEfficiency.h.

MonitorElement* RPCEfficiency::DistBorderClu3La2

Definition at line 138 of file RPCEfficiency.h.

MonitorElement* RPCEfficiency::DistBorderClu3La3

Definition at line 139 of file RPCEfficiency.h.

MonitorElement* RPCEfficiency::DistBorderClu3La4

Definition at line 140 of file RPCEfficiency.h.

MonitorElement* RPCEfficiency::DistBorderClu3La5

Definition at line 141 of file RPCEfficiency.h.

MonitorElement* RPCEfficiency::DistBorderClu3La6

Definition at line 142 of file RPCEfficiency.h.

std::string RPCEfficiency::dt4DSegments
private

Definition at line 229 of file RPCEfficiency.h.

Referenced by analyze(), and RPCEfficiency().

edm::ESHandle<DTGeometry> RPCEfficiency::dtGeo

Definition at line 117 of file RPCEfficiency.h.

Referenced by analyze(), and beginRun().

int RPCEfficiency::dupli
private

Definition at line 226 of file RPCEfficiency.h.

Referenced by analyze(), and RPCEfficiency().

std::string RPCEfficiency::EffRootFileName
private

Definition at line 237 of file RPCEfficiency.h.

Referenced by endRun(), and RPCEfficiency().

bool RPCEfficiency::EffSaveRootFile
private

Definition at line 236 of file RPCEfficiency.h.

Referenced by endRun(), and RPCEfficiency().

std::string RPCEfficiency::folderPath
private

Definition at line 230 of file RPCEfficiency.h.

Referenced by beginRun(), and RPCEfficiency().

MonitorElement* RPCEfficiency::hGlobalResClu1La1

Definition at line 168 of file RPCEfficiency.h.

Referenced by analyze(), and RPCEfficiency().

MonitorElement* RPCEfficiency::hGlobalResClu1La2

Definition at line 169 of file RPCEfficiency.h.

Referenced by analyze(), and RPCEfficiency().

MonitorElement* RPCEfficiency::hGlobalResClu1La3

Definition at line 170 of file RPCEfficiency.h.

Referenced by analyze(), and RPCEfficiency().

MonitorElement* RPCEfficiency::hGlobalResClu1La4

Definition at line 171 of file RPCEfficiency.h.

Referenced by analyze(), and RPCEfficiency().

MonitorElement* RPCEfficiency::hGlobalResClu1La5

Definition at line 172 of file RPCEfficiency.h.

Referenced by analyze(), and RPCEfficiency().

MonitorElement* RPCEfficiency::hGlobalResClu1La6

Definition at line 173 of file RPCEfficiency.h.

Referenced by analyze(), and RPCEfficiency().

MonitorElement* RPCEfficiency::hGlobalResClu1R2A

Definition at line 195 of file RPCEfficiency.h.

Referenced by analyze(), and RPCEfficiency().

MonitorElement* RPCEfficiency::hGlobalResClu1R2B

Definition at line 194 of file RPCEfficiency.h.

Referenced by analyze(), and RPCEfficiency().

MonitorElement* RPCEfficiency::hGlobalResClu1R2C

Definition at line 193 of file RPCEfficiency.h.

Referenced by analyze(), and RPCEfficiency().

MonitorElement* RPCEfficiency::hGlobalResClu1R3A

Definition at line 192 of file RPCEfficiency.h.

Referenced by analyze(), and RPCEfficiency().

MonitorElement* RPCEfficiency::hGlobalResClu1R3B

Definition at line 191 of file RPCEfficiency.h.

Referenced by analyze(), and RPCEfficiency().

MonitorElement* RPCEfficiency::hGlobalResClu1R3C

Definition at line 190 of file RPCEfficiency.h.

Referenced by analyze(), and RPCEfficiency().

MonitorElement* RPCEfficiency::hGlobalResClu2La1

Definition at line 175 of file RPCEfficiency.h.

Referenced by analyze(), and RPCEfficiency().

MonitorElement* RPCEfficiency::hGlobalResClu2La2

Definition at line 176 of file RPCEfficiency.h.

Referenced by analyze(), and RPCEfficiency().

MonitorElement* RPCEfficiency::hGlobalResClu2La3

Definition at line 177 of file RPCEfficiency.h.

Referenced by analyze(), and RPCEfficiency().

MonitorElement* RPCEfficiency::hGlobalResClu2La4

Definition at line 178 of file RPCEfficiency.h.

Referenced by analyze(), and RPCEfficiency().

MonitorElement* RPCEfficiency::hGlobalResClu2La5

Definition at line 179 of file RPCEfficiency.h.

Referenced by analyze(), and RPCEfficiency().

MonitorElement* RPCEfficiency::hGlobalResClu2La6

Definition at line 180 of file RPCEfficiency.h.

Referenced by analyze(), and RPCEfficiency().

MonitorElement* RPCEfficiency::hGlobalResClu2R2A

Definition at line 202 of file RPCEfficiency.h.

Referenced by analyze(), and RPCEfficiency().

MonitorElement* RPCEfficiency::hGlobalResClu2R2B

Definition at line 201 of file RPCEfficiency.h.

Referenced by analyze(), and RPCEfficiency().

MonitorElement* RPCEfficiency::hGlobalResClu2R2C

Definition at line 200 of file RPCEfficiency.h.

Referenced by analyze(), and RPCEfficiency().

MonitorElement* RPCEfficiency::hGlobalResClu2R3A

Definition at line 199 of file RPCEfficiency.h.

Referenced by analyze(), and RPCEfficiency().

MonitorElement* RPCEfficiency::hGlobalResClu2R3B

Definition at line 198 of file RPCEfficiency.h.

Referenced by analyze(), and RPCEfficiency().

MonitorElement* RPCEfficiency::hGlobalResClu2R3C

Definition at line 197 of file RPCEfficiency.h.

Referenced by analyze(), and RPCEfficiency().

MonitorElement* RPCEfficiency::hGlobalResClu3La1

Definition at line 182 of file RPCEfficiency.h.

Referenced by analyze(), and RPCEfficiency().

MonitorElement* RPCEfficiency::hGlobalResClu3La2

Definition at line 183 of file RPCEfficiency.h.

Referenced by analyze(), and RPCEfficiency().

MonitorElement* RPCEfficiency::hGlobalResClu3La3

Definition at line 184 of file RPCEfficiency.h.

Referenced by analyze(), and RPCEfficiency().

MonitorElement* RPCEfficiency::hGlobalResClu3La4

Definition at line 185 of file RPCEfficiency.h.

Referenced by analyze(), and RPCEfficiency().

MonitorElement* RPCEfficiency::hGlobalResClu3La5

Definition at line 186 of file RPCEfficiency.h.

Referenced by analyze(), and RPCEfficiency().

MonitorElement* RPCEfficiency::hGlobalResClu3La6

Definition at line 187 of file RPCEfficiency.h.

Referenced by analyze(), and RPCEfficiency().

MonitorElement* RPCEfficiency::hGlobalResClu3R2A

Definition at line 209 of file RPCEfficiency.h.

Referenced by analyze(), and RPCEfficiency().

MonitorElement* RPCEfficiency::hGlobalResClu3R2B

Definition at line 208 of file RPCEfficiency.h.

Referenced by analyze(), and RPCEfficiency().

MonitorElement* RPCEfficiency::hGlobalResClu3R2C

Definition at line 207 of file RPCEfficiency.h.

Referenced by analyze(), and RPCEfficiency().

MonitorElement* RPCEfficiency::hGlobalResClu3R3A

Definition at line 206 of file RPCEfficiency.h.

Referenced by analyze(), and RPCEfficiency().

MonitorElement* RPCEfficiency::hGlobalResClu3R3B

Definition at line 205 of file RPCEfficiency.h.

Referenced by analyze(), and RPCEfficiency().

MonitorElement* RPCEfficiency::hGlobalResClu3R3C

Definition at line 204 of file RPCEfficiency.h.

Referenced by analyze(), and RPCEfficiency().

bool RPCEfficiency::inclcsc
private

Definition at line 217 of file RPCEfficiency.h.

Referenced by analyze(), beginRun(), and RPCEfficiency().

bool RPCEfficiency::incldt
private

Definition at line 215 of file RPCEfficiency.h.

Referenced by analyze(), beginRun(), and RPCEfficiency().

bool RPCEfficiency::incldtMB4
private

Definition at line 216 of file RPCEfficiency.h.

Referenced by analyze(), beginRun(), and RPCEfficiency().

bool RPCEfficiency::inves
private

Definition at line 220 of file RPCEfficiency.h.

double RPCEfficiency::MaxD
private

Definition at line 224 of file RPCEfficiency.h.

Referenced by analyze(), and RPCEfficiency().

double RPCEfficiency::MaxDrb4
private

Definition at line 225 of file RPCEfficiency.h.

Referenced by analyze(), and RPCEfficiency().

std::map<int, std::map<std::string, MonitorElement*> > RPCEfficiency::meCollection
private

Definition at line 234 of file RPCEfficiency.h.

Referenced by analyze(), and beginRun().

double RPCEfficiency::MinCosAng
private

Definition at line 223 of file RPCEfficiency.h.

Referenced by analyze(), and RPCEfficiency().

std::string RPCEfficiency::muonRPCDigis
private

Definition at line 227 of file RPCEfficiency.h.

Referenced by RPCEfficiency().

std::string RPCEfficiency::nameInLog
private

Definition at line 238 of file RPCEfficiency.h.

Referenced by RPCEfficiency().

std::ofstream RPCEfficiency::ofrej
private

Definition at line 214 of file RPCEfficiency.h.

Referenced by analyze(), and RPCEfficiency().

bool RPCEfficiency::paper
private

Definition at line 219 of file RPCEfficiency.h.

double RPCEfficiency::rangestrips
private

Definition at line 221 of file RPCEfficiency.h.

Referenced by analyze(), and RPCEfficiency().

double RPCEfficiency::rangestripsRB4
private

Definition at line 222 of file RPCEfficiency.h.

Referenced by RPCEfficiency().

std::string RPCEfficiency::rejected
private

Definition at line 231 of file RPCEfficiency.h.

std::string RPCEfficiency::rollseff
private

Definition at line 232 of file RPCEfficiency.h.

std::map<CSCStationIndex,std::set<RPCDetId> > RPCEfficiency::rollstoreCSC

Definition at line 115 of file RPCEfficiency.h.

Referenced by analyze(), and beginRun().

std::map<DTStationIndex,std::set<RPCDetId> > RPCEfficiency::rollstoreDT

Definition at line 114 of file RPCEfficiency.h.

Referenced by analyze(), and beginRun().

edm::ESHandle<RPCGeometry> RPCEfficiency::rpcGeo

Definition at line 116 of file RPCEfficiency.h.

Referenced by analyze(), and beginRun().

edm::InputTag RPCEfficiency::RPCRecHitLabel_

Definition at line 121 of file RPCEfficiency.h.

Referenced by analyze(), and RPCEfficiency().

MonitorElement* RPCEfficiency::statistics

Definition at line 120 of file RPCEfficiency.h.

Referenced by analyze(), and RPCEfficiency().

std::vector<int> RPCEfficiency::totalcounter
private

Definition at line 213 of file RPCEfficiency.h.