Skip to content

Commit

Permalink
Merge pull request #27 from mark-grimes/for-75X-GEM-CSC-Trigger_smart…
Browse files Browse the repository at this point in the history
…Pointers

Convert bare pointers to unique_ptr
  • Loading branch information
Sven Dildick committed Jun 3, 2015
2 parents a711f2e + 44fa272 commit 12fd46e
Show file tree
Hide file tree
Showing 10 changed files with 16 additions and 22 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ CSCTriggerPrimitivesProducer::CSCTriggerPrimitivesProducer(const edm::ParameterS
gemPadDigiProducer_ = conf.existsAs<edm::InputTag>("GEMPadDigiProducer")?conf.getParameter<edm::InputTag>("GEMPadDigiProducer"):edm::InputTag("");
rpcDigiProducer_ = conf.existsAs<edm::InputTag>("RPCDigiProducer")?conf.getParameter<edm::InputTag>("RPCDigiProducer"):edm::InputTag("");
checkBadChambers_ = conf.getParameter<bool>("checkBadChambers");
lctBuilder_ = new CSCTriggerPrimitivesBuilder(conf); // pass on the conf
lctBuilder_.reset( new CSCTriggerPrimitivesBuilder(conf) ); // pass on the conf

wire_token_ = consumes<CSCWireDigiCollection>(wireDigiProducer_);
comp_token_ = consumes<CSCComparatorDigiCollection>(compDigiProducer_);
Expand All @@ -75,7 +75,6 @@ CSCTriggerPrimitivesProducer::CSCTriggerPrimitivesProducer(const edm::ParameterS
CSCTriggerPrimitivesProducer::~CSCTriggerPrimitivesProducer() {
LogDebug("L1CSCTrigger")
<< "deleting trigger primitives after " << iev << " events.";
delete lctBuilder_;
}

//void CSCTriggerPrimitivesProducer::beginRun(const edm::EventSetup& setup) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ class CSCTriggerPrimitivesProducer : public edm::one::EDProducer<edm::one::Share
bool debugParameters_;
// switch to for enabling checking against the list of bad chambers
bool checkBadChambers_;
CSCTriggerPrimitivesBuilder* lctBuilder_;
std::unique_ptr<CSCTriggerPrimitivesBuilder> lctBuilder_;
};

#endif
10 changes: 4 additions & 6 deletions L1Trigger/CSCTriggerPrimitives/src/CSCMotherboard.cc
Original file line number Diff line number Diff line change
Expand Up @@ -148,8 +148,8 @@ CSCMotherboard::CSCMotherboard(unsigned endcap, unsigned station,

infoV = tmbParams.getParameter<int>("verbosity");

alct = new CSCAnodeLCTProcessor(endcap, station, sector, subsector, chamber, alctParams, commonParams);
clct = new CSCCathodeLCTProcessor(endcap, station, sector, subsector, chamber, clctParams, commonParams, tmbParams);
alct.reset( new CSCAnodeLCTProcessor(endcap, station, sector, subsector, chamber, alctParams, commonParams) );
clct.reset( new CSCCathodeLCTProcessor(endcap, station, sector, subsector, chamber, clctParams, commonParams, tmbParams) );

//if (theStation==1 && CSCTriggerNumbering::ringFromTriggerLabels(theStation, theTrigChamber)==2) infoV = 3;

Expand All @@ -176,8 +176,8 @@ CSCMotherboard::CSCMotherboard() :

early_tbins = 4;

alct = new CSCAnodeLCTProcessor();
clct = new CSCCathodeLCTProcessor();
alct.reset( new CSCAnodeLCTProcessor() );
clct.reset( new CSCCathodeLCTProcessor() );
mpc_block_me1a = def_mpc_block_me1a;
alct_trig_enable = def_alct_trig_enable;
clct_trig_enable = def_clct_trig_enable;
Expand All @@ -196,8 +196,6 @@ CSCMotherboard::CSCMotherboard() :
}

CSCMotherboard::~CSCMotherboard() {
if (alct) delete alct;
if (clct) delete clct;
}

void CSCMotherboard::clear() {
Expand Down
4 changes: 2 additions & 2 deletions L1Trigger/CSCTriggerPrimitives/src/CSCMotherboard.h
Original file line number Diff line number Diff line change
Expand Up @@ -75,10 +75,10 @@ class CSCMotherboard
void setConfigParameters(const CSCDBL1TPParameters* conf);

/** Anode LCT processor. */
CSCAnodeLCTProcessor* alct;
std::unique_ptr<CSCAnodeLCTProcessor> alct;

/** Cathode LCT processor. */
CSCCathodeLCTProcessor* clct;
std::unique_ptr<CSCCathodeLCTProcessor> clct;

// VK: change to protected, to allow inheritance
protected:
Expand Down
5 changes: 2 additions & 3 deletions L1Trigger/CSCTriggerPrimitives/src/CSCMotherboardME11.cc
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ CSCMotherboardME11::CSCMotherboardME11(unsigned endcap, unsigned station,
edm::ParameterSet clctParams = conf.getParameter<edm::ParameterSet>("clctSLHC");
edm::ParameterSet tmbParams = conf.getParameter<edm::ParameterSet>("tmbSLHC");

clct1a = new CSCCathodeLCTProcessor(endcap, station, sector, subsector, chamber, clctParams, commonParams, tmbParams);
clct1a.reset( new CSCCathodeLCTProcessor(endcap, station, sector, subsector, chamber, clctParams, commonParams, tmbParams) );
clct1a->setRing(4);

match_earliest_alct_me11_only = tmbParams.getParameter<bool>("matchEarliestAlctME11Only");
Expand Down Expand Up @@ -114,7 +114,7 @@ CSCMotherboardME11::CSCMotherboardME11() : CSCMotherboard()
{
// Constructor used only for testing.

clct1a = new CSCCathodeLCTProcessor();
clct1a.reset( new CSCCathodeLCTProcessor() );
clct1a->setRing(4);

pref[0] = match_trig_window_size/2;
Expand All @@ -128,7 +128,6 @@ CSCMotherboardME11::CSCMotherboardME11() : CSCMotherboard()

CSCMotherboardME11::~CSCMotherboardME11()
{
if (clct1a) delete clct1a;
}


Expand Down
2 changes: 1 addition & 1 deletion L1Trigger/CSCTriggerPrimitives/src/CSCMotherboardME11.h
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ class CSCMotherboardME11 : public CSCMotherboard
void setConfigParameters(const CSCDBL1TPParameters* conf);

/** additional Cathode LCT processor for ME1a */
CSCCathodeLCTProcessor* clct1a;
std::unique_ptr<CSCCathodeLCTProcessor> clct1a;

std::vector<CSCCorrelatedLCTDigi> readoutLCTs1a();
std::vector<CSCCorrelatedLCTDigi> readoutLCTs1b();
Expand Down
5 changes: 2 additions & 3 deletions L1Trigger/CSCTriggerPrimitives/src/CSCMotherboardME11GEM.cc
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ CSCMotherboardME11GEM::CSCMotherboardME11GEM(unsigned endcap, unsigned station,
const edm::ParameterSet clctParams(conf.getParameter<edm::ParameterSet>("clctSLHC"));
const edm::ParameterSet me11tmbParams(conf.getParameter<edm::ParameterSet>("me11tmbSLHCGEM"));

clct1a = new CSCCathodeLCTProcessor(endcap, station, sector, subsector, chamber, clctParams, commonParams, me11tmbParams);
clct1a.reset( new CSCCathodeLCTProcessor(endcap, station, sector, subsector, chamber, clctParams, commonParams, me11tmbParams) );
clct1a->setRing(4);

match_earliest_alct_me11_only = me11tmbParams.getParameter<bool>("matchEarliestAlctME11Only");
Expand Down Expand Up @@ -310,7 +310,7 @@ CSCMotherboardME11GEM::CSCMotherboardME11GEM() : CSCMotherboard()
{
// Constructor used only for testing.

clct1a = new CSCCathodeLCTProcessor();
clct1a.reset( new CSCCathodeLCTProcessor() );
clct1a->setRing(4);

pref[0] = match_trig_window_size/2;
Expand All @@ -324,7 +324,6 @@ CSCMotherboardME11GEM::CSCMotherboardME11GEM() : CSCMotherboard()

CSCMotherboardME11GEM::~CSCMotherboardME11GEM()
{
if (clct1a) delete clct1a;
}


Expand Down
2 changes: 1 addition & 1 deletion L1Trigger/CSCTriggerPrimitives/src/CSCMotherboardME11GEM.h
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ class CSCMotherboardME11GEM : public CSCMotherboard
void setConfigParameters(const CSCDBL1TPParameters* conf);

/** additional Cathode LCT processor for ME1a */
CSCCathodeLCTProcessor* clct1a;
std::unique_ptr<CSCCathodeLCTProcessor> clct1a;

std::vector<CSCCorrelatedLCTDigi> readoutLCTs1a();
std::vector<CSCCorrelatedLCTDigi> readoutLCTs1b();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ CSCTriggerPrimitivesBuilder::CSCTriggerPrimitivesBuilder(const edm::ParameterSet
m_maxBX = conf.getParameter<int>("MaxBX");

// Init MPC
m_muonportcard = new CSCMuonPortCard(conf);
m_muonportcard.reset( new CSCMuonPortCard(conf) );
}

//------------
Expand All @@ -136,7 +136,6 @@ CSCTriggerPrimitivesBuilder::~CSCTriggerPrimitivesBuilder()
}
}
}
delete m_muonportcard;
}

//------------
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ class CSCTriggerPrimitivesBuilder
const RPCGeometry* rpc_g;

/** Pointer to MPC processor. */
CSCMuonPortCard* m_muonportcard;
std::unique_ptr<CSCMuonPortCard> m_muonportcard;
};

#endif

0 comments on commit 12fd46e

Please sign in to comment.