Skip to content

Commit

Permalink
code-format fix
Browse files Browse the repository at this point in the history
  • Loading branch information
igv4321 committed Sep 12, 2024
1 parent 1f6e0cb commit 3c0b14f
Show file tree
Hide file tree
Showing 4 changed files with 268 additions and 325 deletions.
38 changes: 19 additions & 19 deletions CalibCalorimetry/HcalAlgos/interface/HcalPulseShapeLookup.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,30 +14,30 @@
// lookup scheme and can accommodate more pulse shapes.
class HcalPulseShapeLookup {
public:
typedef HcalPulseShape Shape;
typedef std::pair<std::string,Shape> LabeledShape;
typedef HcalPulseShape Shape;
typedef std::pair<std::string, Shape> LabeledShape;

HcalPulseShapeLookup(const std::vector<LabeledShape>& shapes,
const std::vector<int>& channelToTypeLookup,
const HcalTopology* htopo);
HcalPulseShapeLookup(const std::vector<LabeledShape>& shapes,
const std::vector<int>& channelToTypeLookup,
const HcalTopology* htopo);

inline unsigned nShapeTypes() const {return theShapes_.size();}
const Shape& getShape(int shapeType) const;
const std::string& getLabel(int shapeType) const;
inline unsigned nShapeTypes() const { return theShapes_.size(); }
const Shape& getShape(int shapeType) const;
const std::string& getLabel(int shapeType) const;

int getShapeType(unsigned linearizedChannelNumber) const;
const Shape& getChannelShape(unsigned linearizedChannelNumber) const;
const std::string& getChannelLabel(unsigned linearizedChannelNumber) const;
int getShapeType(unsigned linearizedChannelNumber) const;
const Shape& getChannelShape(unsigned linearizedChannelNumber) const;
const std::string& getChannelLabel(unsigned linearizedChannelNumber) const;

int getShapeType(const DetId &id) const;
const Shape& getChannelShape(const DetId &id) const;
const std::string& getChannelLabel(const DetId &id) const;
int getShapeType(const DetId& id) const;
const Shape& getChannelShape(const DetId& id) const;
const std::string& getChannelLabel(const DetId& id) const;

private:
std::vector<LabeledShape> theShapes_;
std::vector<int> shapeTypes_;
// We do not own the pointer
const HcalTopology* htopo_;
std::vector<LabeledShape> theShapes_;
std::vector<int> shapeTypes_;
// We do not own the pointer
const HcalTopology* htopo_;
};

#endif // CalibCalorimetry_HcalAlgos_HcalPulseShapeLookup_h
#endif // CalibCalorimetry_HcalAlgos_HcalPulseShapeLookup_h
59 changes: 19 additions & 40 deletions CalibCalorimetry/HcalAlgos/src/HcalPulseShapeLookup.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2,58 +2,37 @@

#include "CalibCalorimetry/HcalAlgos/interface/HcalPulseShapeLookup.h"

HcalPulseShapeLookup::HcalPulseShapeLookup(
const std::vector<LabeledShape>& shapes,
const std::vector<int>& channelToTypeLookup,
const HcalTopology* htopo)
: theShapes_(shapes),
shapeTypes_(channelToTypeLookup),
htopo_(htopo)
{
assert(htopo_);
HcalPulseShapeLookup::HcalPulseShapeLookup(const std::vector<LabeledShape>& shapes,
const std::vector<int>& channelToTypeLookup,
const HcalTopology* htopo)
: theShapes_(shapes), shapeTypes_(channelToTypeLookup), htopo_(htopo) {
assert(htopo_);
}

const HcalPulseShapeLookup::Shape& HcalPulseShapeLookup::getShape(
const int shapeType) const
{
return theShapes_.at(shapeType).second;
const HcalPulseShapeLookup::Shape& HcalPulseShapeLookup::getShape(const int shapeType) const {
return theShapes_.at(shapeType).second;
}

const std::string& HcalPulseShapeLookup::getLabel(
const int shapeType) const
{
return theShapes_.at(shapeType).first;
}
const std::string& HcalPulseShapeLookup::getLabel(const int shapeType) const { return theShapes_.at(shapeType).first; }

int HcalPulseShapeLookup::getShapeType(
const unsigned linearizedChannelNumber) const
{
return shapeTypes_.at(linearizedChannelNumber);
int HcalPulseShapeLookup::getShapeType(const unsigned linearizedChannelNumber) const {
return shapeTypes_.at(linearizedChannelNumber);
}

int HcalPulseShapeLookup::getShapeType(const DetId &id) const
{
return getShapeType(htopo_->detId2denseId(id));
}
int HcalPulseShapeLookup::getShapeType(const DetId& id) const { return getShapeType(htopo_->detId2denseId(id)); }

const HcalPulseShapeLookup::Shape& HcalPulseShapeLookup::getChannelShape(
const unsigned linearizedChannelNumber) const
{
return theShapes_.at(shapeTypes_.at(linearizedChannelNumber)).second;
const HcalPulseShapeLookup::Shape& HcalPulseShapeLookup::getChannelShape(const unsigned linearizedChannelNumber) const {
return theShapes_.at(shapeTypes_.at(linearizedChannelNumber)).second;
}

const std::string& HcalPulseShapeLookup::getChannelLabel(
const unsigned linearizedChannelNumber) const
{
return theShapes_.at(shapeTypes_.at(linearizedChannelNumber)).first;
const std::string& HcalPulseShapeLookup::getChannelLabel(const unsigned linearizedChannelNumber) const {
return theShapes_.at(shapeTypes_.at(linearizedChannelNumber)).first;
}

const HcalPulseShapeLookup::Shape& HcalPulseShapeLookup::getChannelShape(const DetId &id) const
{
return getChannelShape(htopo_->detId2denseId(id));
const HcalPulseShapeLookup::Shape& HcalPulseShapeLookup::getChannelShape(const DetId& id) const {
return getChannelShape(htopo_->detId2denseId(id));
}

const std::string& HcalPulseShapeLookup::getChannelLabel(const DetId &id) const
{
return getChannelLabel(htopo_->detId2denseId(id));
const std::string& HcalPulseShapeLookup::getChannelLabel(const DetId& id) const {
return getChannelLabel(htopo_->detId2denseId(id));
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,8 @@
#include "Geometry/Records/interface/HcalRecNumberingRecord.h"
#include "Geometry/Records/interface/CaloGeometryRecord.h"

class HcalPulseShapeLookupRcd
: public edm::eventsetup::
DependentRecordImplementation<HcalPulseShapeLookupRcd, edm::mpl::Vector<HcalRecNumberingRecord, CaloGeometryRecord> > {
};
class HcalPulseShapeLookupRcd : public edm::eventsetup::DependentRecordImplementation<
HcalPulseShapeLookupRcd,
edm::mpl::Vector<HcalRecNumberingRecord, CaloGeometryRecord> > {};

#endif // RecoLocalCalo_HcalRecAlgos_HcalPulseShapeLookupRcd_h
#endif // RecoLocalCalo_HcalRecAlgos_HcalPulseShapeLookupRcd_h
Loading

0 comments on commit 3c0b14f

Please sign in to comment.