Skip to content

Commit

Permalink
Code check
Browse files Browse the repository at this point in the history
  • Loading branch information
Sunanda committed Nov 12, 2022
1 parent 456cc10 commit 96276cd
Show file tree
Hide file tree
Showing 6 changed files with 79 additions and 71 deletions.
18 changes: 7 additions & 11 deletions Alignment/OfflineValidation/plugins/MuonAlignmentAnalyzer.cc
Expand Up @@ -215,7 +215,6 @@ MuonAlignmentAnalyzer::MuonAlignmentAnalyzer(const edm::ParameterSet &pset)
hprofGlobalRCSC(nullptr) {
usesResource(TFileService::kSharedResource);


if (theDataType != "RealData" && theDataType != "SimData")
edm::LogError("MuonAlignmentAnalyzer") << "Error in Data Type!!" << std::endl;

Expand All @@ -225,9 +224,6 @@ MuonAlignmentAnalyzer::MuonAlignmentAnalyzer(const edm::ParameterSet &pset)
numberOfHits = 0;
}

/// Destructor
MuonAlignmentAnalyzer::~MuonAlignmentAnalyzer() {}

void MuonAlignmentAnalyzer::beginJob() {
// eventSetup.get<IdealMagneticFieldRecord>().get(theMGField);

Expand Down Expand Up @@ -1720,7 +1716,7 @@ void MuonAlignmentAnalyzer::analyze(const edm::Event &event, const edm::EventSet
int i = 0, ie = 0, ib = 0;

// Get the SimTrack collection from the event
const edm::Handle<edm::SimTrackContainer>& simTracks = event.getHandle(simTrackToken_);
const edm::Handle<edm::SimTrackContainer> &simTracks = event.getHandle(simTrackToken_);

edm::SimTrackContainer::const_iterator simTrack;

Expand Down Expand Up @@ -1784,7 +1780,7 @@ void MuonAlignmentAnalyzer::analyze(const edm::Event &event, const edm::EventSet
double ich = 0;

// Get the RecTrack collection from the event
const edm::Handle<reco::TrackCollection>& staTracks = event.getHandle(staTrackToken_);
const edm::Handle<reco::TrackCollection> &staTracks = event.getHandle(staTrackToken_);
numberOfSARecTracks += staTracks->size();

reco::TrackCollection::const_iterator staTrack;
Expand Down Expand Up @@ -1879,7 +1875,7 @@ void MuonAlignmentAnalyzer::analyze(const edm::Event &event, const edm::EventSet

if (doGBplots) {
// Get the RecTrack collection from the event
const edm::Handle<reco::TrackCollection>& glbTracks = event.getHandle(glbTrackToken_);
const edm::Handle<reco::TrackCollection> &glbTracks = event.getHandle(glbTrackToken_);
numberOfGBRecTracks += glbTracks->size();

double GBrecPt = 0;
Expand Down Expand Up @@ -1982,17 +1978,17 @@ void MuonAlignmentAnalyzer::analyze(const edm::Event &event, const edm::EventSet

if (doResplots) {
const MagneticField *theMGField = &eventSetup.getData(magFieldToken_);
const edm::ESHandle<GlobalTrackingGeometry>& theTrackingGeometry = eventSetup.getHandle(trackingGeometryToken_);
const edm::ESHandle<GlobalTrackingGeometry> &theTrackingGeometry = eventSetup.getHandle(trackingGeometryToken_);

// Get the RecTrack collection from the event
const edm::Handle<reco::TrackCollection>& staTracks = event.getHandle(staTrackToken_);
const edm::Handle<reco::TrackCollection> &staTracks = event.getHandle(staTrackToken_);

// Get the 4D DTSegments
const edm::Handle<DTRecSegment4DCollection>& all4DSegmentsDT = event.getHandle(allDTSegmentToken_);
const edm::Handle<DTRecSegment4DCollection> &all4DSegmentsDT = event.getHandle(allDTSegmentToken_);
DTRecSegment4DCollection::const_iterator segmentDT;

// Get the 4D CSCSegments
const edm::Handle<CSCSegmentCollection>& all4DSegmentsCSC = event.getHandle(allCSCSegmentToken_);
const edm::Handle<CSCSegmentCollection> &all4DSegmentsCSC = event.getHandle(allCSCSegmentToken_);
CSCSegmentCollection::const_iterator segmentCSC;

//Vectors used to perform the matching between Segments and hits from Track
Expand Down
Expand Up @@ -54,7 +54,7 @@ class MuonAlignmentAnalyzer : public edm::one::EDAnalyzer<edm::one::SharedResour
MuonAlignmentAnalyzer(const edm::ParameterSet &pset);

/// Destructor
~MuonAlignmentAnalyzer() override;
~MuonAlignmentAnalyzer() override = default;

// Operations

Expand Down
25 changes: 14 additions & 11 deletions Alignment/OfflineValidation/plugins/ResidualRefitting.cc
Expand Up @@ -167,7 +167,8 @@ void ResidualRefitting::analyze(const edm::Event& event, const edm::EventSetup&
if (iGmrRemake > 0 || iGmrCyl > 0) {
outputTree_->Fill();
edm::LogVerbatim("ResidualRefitting") << "FILLING NTUPLE!";
edm::LogVerbatim("ResidualRefitting") << "Entries Recorded: " << outputTree_->GetEntries() << " Branch :: " << outputBranch_->GetEntries();
edm::LogVerbatim("ResidualRefitting")
<< "Entries Recorded: " << outputTree_->GetEntries() << " Branch :: " << outputBranch_->GetEntries();
} else
edm::LogVerbatim("ResidualRefitting") << "no tracks -- no fill!\n";

Expand Down Expand Up @@ -506,8 +507,9 @@ void ResidualRefitting::StoreTrackerRecHits(DetId detid, const TrackerTopology*
ladder = tTopo->pxbLadder(detid.rawId());
module = tTopo->pxbModule(detid.rawId());
if (debug_)
edm::LogVerbatim("ResidualRefitting") << "PXB"
<< "\tlayer = " << layer << "\tladder = " << ladder << "\tmodule = " << module;
edm::LogVerbatim("ResidualRefitting")
<< "PXB"
<< "\tlayer = " << layer << "\tladder = " << ladder << "\tmodule = " << module;

} else if (subdetector == ResidualRefitting::PXF) {
side = tTopo->pxfSide(detid.rawId());
Expand All @@ -517,36 +519,36 @@ void ResidualRefitting::StoreTrackerRecHits(DetId detid, const TrackerTopology*
module = tTopo->pxfModule(detid.rawId());
if (debug_)
edm::LogVerbatim("ResidualRefitting") << "PXF"
<< "\tside = " << side << "\tdisk = " << disk << "\tblade = " << blade << "\tpanel = " << panel
<< "\tmodule = " << module;
<< "\tside = " << side << "\tdisk = " << disk << "\tblade = " << blade
<< "\tpanel = " << panel << "\tmodule = " << module;

} else if (subdetector == ResidualRefitting::TIB) {
layer = tTopo->tibLayer(detid.rawId());
module = tTopo->tibModule(detid.rawId());
if (debug_)
edm::LogVerbatim("ResidualRefitting") << "TIB"
<< "\tlayer = " << layer << "\tmodule = " << module;
<< "\tlayer = " << layer << "\tmodule = " << module;
} else if (subdetector == ResidualRefitting::TID) {
side = tTopo->tidSide(detid.rawId());
wheel = tTopo->tidWheel(detid.rawId());
ring = tTopo->tidRing(detid.rawId());
if (debug_)
edm::LogVerbatim("ResidualRefitting") << "TID"
<< "\tside = " << side << "\twheel = " << wheel << "\tring = " << ring;
<< "\tside = " << side << "\twheel = " << wheel << "\tring = " << ring;

} else if (subdetector == ResidualRefitting::TOB) {
layer = tTopo->tobLayer(detid.rawId());
module = tTopo->tobModule(detid.rawId());
if (debug_)
edm::LogVerbatim("ResidualRefitting") << "TOB"
<< "\tlayer = " << layer << "\tmodule = " << module;
<< "\tlayer = " << layer << "\tmodule = " << module;

} else if (subdetector == ResidualRefitting::TEC) {
ring = tTopo->tecRing(detid.rawId());
module = tTopo->tecModule(detid.rawId());
if (debug_)
edm::LogVerbatim("ResidualRefitting") << "TEC"
<< "\tring = " << ring << "\tmodule = " << module;
<< "\tring = " << ring << "\tmodule = " << module;
}

//Do Storage
Expand Down Expand Up @@ -1081,8 +1083,9 @@ FreeTrajectoryState ResidualRefitting::freeTrajStateMuon(reco::TrackRef muon) {
math::XYZPoint innerPos = muon->referencePoint();
math::XYZVector innerMom = muon->momentum();
if (debug_)
edm::LogVerbatim("ResidualRefitting") << "Inner Pos: "
<< "\tx = " << innerPos.X() << "\ty = " << innerPos.Y() << "\tz = " << innerPos.Z();
edm::LogVerbatim("ResidualRefitting")
<< "Inner Pos: "
<< "\tx = " << innerPos.X() << "\ty = " << innerPos.Y() << "\tz = " << innerPos.Z();

GlobalPoint innerPoint(innerPos.X(), innerPos.Y(), innerPos.Z());
GlobalVector innerVec(innerMom.X(), innerMom.Y(), innerMom.Z());
Expand Down
3 changes: 2 additions & 1 deletion Alignment/OfflineValidation/plugins/ResidualRefitting.h
Expand Up @@ -332,7 +332,8 @@ class ResidualRefitting : public edm::one::EDAnalyzer<> {
std::string PropagatorSource_;

// names of product labels
const edm::InputTag tracks_, muons_, muonsRemake_, muonsNoStation1_, muonsNoStation2_, muonsNoStation3_, muonsNoStation4_; //Global Muon Collections
const edm::InputTag tracks_, muons_, muonsRemake_, muonsNoStation1_, muonsNoStation2_, muonsNoStation3_,
muonsNoStation4_; //Global Muon Collections

const bool debug_;
const edm::EDGetTokenT<reco::MuonCollection> muonsToken_;
Expand Down

0 comments on commit 96276cd

Please sign in to comment.