Skip to content

Commit

Permalink
Unused maps and lines removed from RPCDidisValid
Browse files Browse the repository at this point in the history
  • Loading branch information
mileva committed Jun 16, 2014
1 parent 8bc39a0 commit b66c421
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 96 deletions.
23 changes: 2 additions & 21 deletions Validation/MuonRPCDigis/interface/RPCDigiValid.h
Expand Up @@ -3,25 +3,19 @@

#include "FWCore/Framework/interface/Frameworkfwd.h"
#include "FWCore/Framework/interface/EDAnalyzer.h"

#include "FWCore/Framework/interface/Event.h"
#include "FWCore/Framework/interface/EventSetup.h"
#include "FWCore/Framework/interface/ESHandle.h"
#include "FWCore/Framework/interface/MakerMacros.h"

#include "FWCore/ParameterSet/interface/ParameterSet.h"
#include "FWCore/MessageLogger/interface/MessageLogger.h"

#include "DQMServices/Core/interface/DQMStore.h"

#include "FWCore/ServiceRegistry/interface/Service.h"
#include "FWCore/Utilities/interface/InputTag.h"

#include <iostream>
#include <string>
#include "DQMServices/Core/interface/MonitorElement.h"
#include "DataFormats/MuonDetId/interface/RPCDetId.h"

#include "CommonTools/UtilAlgos/interface/TFileService.h"
#include "TH1F.h"

Expand Down Expand Up @@ -94,24 +88,22 @@ class RPCDigiValid: public edm::EDAnalyzer
MonitorElement* clsBarrel;

//CLS Validation
//ring2, disc +- 1
//ring2, disk +- 1
MonitorElement* CLS_Endcap_1_Ring2_A;
MonitorElement* CLS_Endcap_1_Ring2_B;
MonitorElement* CLS_Endcap_1_Ring2_C;

//ring2, disc +-2 & +-3
MonitorElement* CLS_Endcap_23_Ring2_A;
MonitorElement* CLS_Endcap_23_Ring2_B;
MonitorElement* CLS_Endcap_23_Ring2_C;

//ring 3, all discs
//ring 3
MonitorElement* CLS_Endcap_123_Ring3_A;
MonitorElement* CLS_Endcap_123_Ring3_B;
MonitorElement* CLS_Endcap_123_Ring3_C;
//CLS Validation

//4 endcap

MonitorElement *ResDmin4;
MonitorElement *ResDplu4;
MonitorElement *BxDisc_4Plus;
Expand All @@ -120,17 +112,6 @@ class RPCDigiValid: public edm::EDAnalyzer
MonitorElement *xyvDmin4;
MonitorElement *CLS_Endcap_4;

//new members for the noise
std::map<RPCDetId, double> mapRollCls;
std::map<RPCDetId, double> mapRollArea;
std::map<RPCDetId, double> mapRollStripArea;
std::map<RPCDetId, int> mapRollFakeCount;
std::map<RPCDetId, int> mapRollTruCount;
std::map<RPCDetId, std::string> mapRollName;
std::map<RPCDetId, std::map<int, double>*> mapRollStripRate;
std::map<RPCDetId, std::map<int, double>*> mapRollNoisyStripRate;
int countEvent;

DQMStore* dbe_;
std::string outputFile_;
std::string digiLabel;
Expand Down
76 changes: 1 addition & 75 deletions Validation/MuonRPCDigis/src/RPCDigiValid.cc
Expand Up @@ -10,7 +10,6 @@
#include "DataFormats/GeometryVector/interface/LocalPoint.h"
#include "DQMServices/Core/interface/DQMStore.h"
#include <cmath>
#include <Geometry/RPCGeometry/interface/RPCGeomServ.h>

using namespace std;
using namespace edm;
Expand Down Expand Up @@ -38,10 +37,6 @@ RPCDigiValid::~RPCDigiValid()
void RPCDigiValid::analyze(const Event& event, const EventSetup& eventSetup)
{

countEvent++;
// cout << endl <<"--- [RPCDigiQuality] Analysing Event: #Run: " << event.id().run()
// << " #Event: " << event.id().event() << endl;

// Get the RPC Geometry
edm::ESHandle<RPCGeometry> rpcGeom;
eventSetup.get<MuonGeometryRecord> ().get(rpcGeom);
Expand All @@ -63,7 +58,6 @@ void RPCDigiValid::analyze(const Event& event, const EventSetup& eventSetup)
const RPCRoll* soll = dynamic_cast<const RPCRoll*> (rpcGeom->roll(Rsid));
int ptype = simIt->particleType();

// std::cout <<"This is a Simhit with Parent "<<ptype<<std::endl;
if (ptype == 13 || ptype == -13)
{

Expand All @@ -76,8 +70,6 @@ void RPCDigiValid::analyze(const Event& event, const EventSetup& eventSetup)
buff.push_back(simIt->localPosition().x());

allsims[Rsid] = buff;

// std::cout << "allsims[Rsid] = " << std::endl;
}
GlobalPoint p = soll->toGlobal(simIt->localPosition());

Expand All @@ -100,8 +92,6 @@ void RPCDigiValid::analyze(const Event& event, const EventSetup& eventSetup)
xyvDmin4->Fill(sim_x, sim_y);
}
}

// xyview->Fill(p.x(),p.y());
rzview->Fill(p.z(), p.perp());
}
//loop over Digis
Expand All @@ -111,20 +101,14 @@ void RPCDigiValid::analyze(const Event& event, const EventSetup& eventSetup)
const RPCDetId Rsid = (*detUnitIt).first;
const RPCRoll* roll = dynamic_cast<const RPCRoll*> (rpcGeom->roll(Rsid));

RPCGeomServ rpcsrv(roll->id());
std::string name = rpcsrv.name();
//std:: cout << (roll->id().rawId()) << "\t" << name << std::endl;


const RPCDigiCollection::Range& range = (*detUnitIt).second;
std::vector<double> sims;
if (allsims.find(Rsid) != allsims.end())
{
sims = allsims[Rsid];
}

//int ndigi=0;
double ndigi = 0;
int ndigi=0;
for (RPCDigiCollection::const_iterator digiIt = range.first; digiIt != range.second; ++digiIt)
{
StripProf->Fill(digiIt->strip());
Expand All @@ -140,57 +124,9 @@ void RPCDigiValid::analyze(const Event& event, const EventSetup& eventSetup)
if (Rsid.station() == 4)
BxDisc_4Min->Fill(digiIt->bx());
}
map<int, double>* stripRate = mapRollStripRate[Rsid.rawId()];
map<int, double>* stripNoisyRate = mapRollNoisyStripRate[Rsid.rawId()];
//init map strip rate
if (stripRate == 0)
{
stripRate = new map<int, double> ();
mapRollStripRate[Rsid.rawId()] = stripRate;
}
(*stripRate)[digiIt->strip()] += 1;

//noisy only
if (sims.size() == 0)
{
if (stripNoisyRate == 0)
{
stripNoisyRate = new map<int, double> ();
mapRollNoisyStripRate[Rsid.rawId()] = stripNoisyRate;
}
(*stripNoisyRate)[digiIt->strip()] += 1;

}

// std::cout << Rsid.rawId() << "\tstrip = " << digiIt->strip() << std::endl;
ndigi++;
// std::cout << "digis = " << ndigi << std::endl;
}

double area = 0.0;
double stripArea = 0.0;

if (Rsid.region() == 0)
{
const RectangularStripTopology* top_ = dynamic_cast<const RectangularStripTopology*> (&(roll->topology()));
float xmin = (top_->localPosition(0.)).x();
float xmax = (top_->localPosition((float) roll->nstrips())).x();
float striplength = (top_->stripLength());
area = striplength * (xmax - xmin);
stripArea = area / ((float) roll->nstrips());
}
else
{
const TrapezoidalStripTopology* top_ = dynamic_cast<const TrapezoidalStripTopology*> (&(roll->topology()));
float xmin = (top_->localPosition(0.)).x();
float xmax = (top_->localPosition((float) roll->nstrips())).x();
float striplength = (top_->stripLength());
area = striplength * (xmax - xmin);
stripArea = area / ((float) roll->nstrips());
}

mapRollTruCount[Rsid] += 1;

if (sims.size() == 0)
{
noiseCLS->Fill(ndigi);
Expand All @@ -202,14 +138,7 @@ void RPCDigiValid::analyze(const Event& event, const EventSetup& eventSetup)
{
noiseCLSEndcaps->Fill(ndigi);
}

mapRollCls[Rsid] += ndigi;
mapRollFakeCount[Rsid] += 1;
}
mapRollArea[Rsid] = area;
mapRollStripArea[Rsid] = stripArea;
mapRollName[Rsid] = name;

//CLS histos
if (Rsid.region() == 0)
{
Expand Down Expand Up @@ -252,7 +181,6 @@ void RPCDigiValid::analyze(const Event& event, const EventSetup& eventSetup)
CLS_Endcap_4->Fill(ndigi);
}

//cls histos
if (sims.size() == 1 && ndigi == 1)
{
double dis = roll->centreOfStrip(range.first->strip()).x() - sims[0];
Expand Down Expand Up @@ -360,8 +288,6 @@ void RPCDigiValid::endJob()

void RPCDigiValid::beginRun(edm::Run const& run, edm::EventSetup const& eSetup)
{
countEvent = 0;

if (dbe_)
{
dbe_->setCurrentFolder("RPCDigisV/RPCDigis");
Expand Down

0 comments on commit b66c421

Please sign in to comment.