Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion AnalysisDataFormats/SUSYBSMObjects/src/classes_def.xml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
<class name="edm::Wrapper<susybsm::HSCPDeDxInfoValueMap>"/>

<class name="susybsm::MuonSegment" ClassVersion="3">
<version ClassVersion="3" checksum="3212731337"/>
<version ClassVersion="3" checksum="2764789041"/>
</class>
<class name="susybsm::MuonSegmentCollection"/>
<class name="susybsm::MuonSegmentRef"/>
Expand Down
115 changes: 59 additions & 56 deletions DataFormats/DTRecHit/interface/DTRecHit1D.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,80 +22,83 @@
class DTLayer;
class GeomDet;

class DTRecHit1D : public RecHit1D {
public:
/// Constructor from wireId and digi time only.
DTRecHit1D(const DTWireId& wireId, DTEnums::DTCellSide lr, float digiTime);
namespace io_v1 {
class DTRecHit1D : public RecHit1D {
public:
/// Constructor from wireId and digi time only.
DTRecHit1D(const DTWireId& wireId, DTEnums::DTCellSide lr, float digiTime);

/// Default constructor
DTRecHit1D();
/// Default constructor
DTRecHit1D();

/// Constructor from a local position, wireId and digi time.
/// The 3-dimensional local error is defined as
/// resolution (the cell resolution) for the coordinate being measured
/// and 0 for the two other coordinates
DTRecHit1D(const DTWireId& wireId, DTEnums::DTCellSide lr, float digiTime, const LocalPoint& pos);
/// Constructor from a local position, wireId and digi time.
/// The 3-dimensional local error is defined as
/// resolution (the cell resolution) for the coordinate being measured
/// and 0 for the two other coordinates
DTRecHit1D(const DTWireId& wireId, DTEnums::DTCellSide lr, float digiTime, const LocalPoint& pos);

/// Constructor from a local position and error, wireId and digi time.
DTRecHit1D(
const DTWireId& wireId, DTEnums::DTCellSide lr, float digiTime, const LocalPoint& pos, const LocalError& err);
/// Constructor from a local position and error, wireId and digi time.
DTRecHit1D(
const DTWireId& wireId, DTEnums::DTCellSide lr, float digiTime, const LocalPoint& pos, const LocalError& err);

/// Destructor
~DTRecHit1D() override;
/// Destructor
~DTRecHit1D() override;

/// Return the 3-dimensional local position
LocalPoint localPosition() const override { return theLocalPosition; }
/// Return the 3-dimensional local position
LocalPoint localPosition() const override { return theLocalPosition; }

/// Return the 3-dimensional error on the local position
LocalError localPositionError() const override { return theLocalError; }
/// Return the 3-dimensional error on the local position
LocalError localPositionError() const override { return theLocalError; }

DTRecHit1D* clone() const override;
DTRecHit1D* clone() const override;

/// No components rechits: it returns a null vector
std::vector<const TrackingRecHit*> recHits() const override;
/// No components rechits: it returns a null vector
std::vector<const TrackingRecHit*> recHits() const override;

/// No components rechits: it returns a null vector
std::vector<TrackingRecHit*> recHits() override;
/// No components rechits: it returns a null vector
std::vector<TrackingRecHit*> recHits() override;

/// The side of the cell
DTEnums::DTCellSide lrSide() const { return theLRSide; }
/// The side of the cell
DTEnums::DTCellSide lrSide() const { return theLRSide; }

/// Set local position
void setPosition(LocalPoint pos) { theLocalPosition = pos; }
/// Set local position
void setPosition(LocalPoint pos) { theLocalPosition = pos; }

/// Set local position error
void setError(LocalError err) { theLocalError = err; }
/// Set local position error
void setError(LocalError err) { theLocalError = err; }

/// Set the local position and its error
void setPositionAndError(LocalPoint pos, LocalError err) {
theLocalPosition = pos;
theLocalError = err;
}
/// Set the local position and its error
void setPositionAndError(LocalPoint pos, LocalError err) {
theLocalPosition = pos;
theLocalError = err;
}

/// Return the wireId
DTWireId wireId() const { return theWireId; }
/// Return the wireId
DTWireId wireId() const { return theWireId; }

/// Return the time (ns) of the digi used to build the rechit
float digiTime() const { return theDigiTime; }
/// Return the time (ns) of the digi used to build the rechit
float digiTime() const { return theDigiTime; }

/// Comparison operator, based on the wireId and the digi time
bool operator==(const DTRecHit1D& hit) const;
/// Comparison operator, based on the wireId and the digi time
bool operator==(const DTRecHit1D& hit) const;

private:
// The wire id
DTWireId theWireId;
private:
// The wire id
DTWireId theWireId;

// Left/Right side code
DTEnums::DTCellSide theLRSide;
// Left/Right side code
DTEnums::DTCellSide theLRSide;

// The digi time used to reconstruct the hit
float theDigiTime;
// The digi time used to reconstruct the hit
float theDigiTime;

// Position and error in the Local Ref. Frame of the DTLayer
LocalPoint theLocalPosition;
LocalError theLocalError;
};
#endif
// Position and error in the Local Ref. Frame of the DTLayer
LocalPoint theLocalPosition;
LocalError theLocalError;
};

/// The ostream operator
std::ostream& operator<<(std::ostream& os, const DTRecHit1D& hit);
/// The ostream operator
std::ostream& operator<<(std::ostream& os, const DTRecHit1D& hit);
} // namespace io_v1
using DTRecHit1D = io_v1::DTRecHit1D;
#endif
5 changes: 4 additions & 1 deletion DataFormats/DTRecHit/interface/DTRecHit1DFwd.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
#ifndef DataFormats_DTRecHit_DTRecHit1D_h
#define DataFormats_DTRecHit_DTRecHit1D_h

class DTRecHit1D;
namespace io_v1 {
class DTRecHit1D;
}
using DTRecHit1D = io_v1::DTRecHit1D;
#endif
124 changes: 63 additions & 61 deletions DataFormats/DTRecHit/interface/DTRecHit1DPair.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,87 +23,89 @@

class DTLayer;

class DTRecHit1DPair : public RecHit1D {
public:
/// Constructor without components: must use setPos and Err!
DTRecHit1DPair(const DTWireId& wireId, const DTDigi& digi);
namespace io_v1 {
class DTRecHit1DPair : public RecHit1D {
public:
/// Constructor without components: must use setPos and Err!
DTRecHit1DPair(const DTWireId& wireId, const DTDigi& digi);

/// Default constructor. Needed to write the RecHit into a STL container.
DTRecHit1DPair();
/// Default constructor. Needed to write the RecHit into a STL container.
DTRecHit1DPair();

/// Destructor
~DTRecHit1DPair() override;
/// Destructor
~DTRecHit1DPair() override;

// Operations
// Operations

DTRecHit1DPair* clone() const override;
DTRecHit1DPair* clone() const override;

/// Return the 3-dimensional local position.
/// The average theLeftHit/theRightHit hits position, namely the wire position
/// is returned.
LocalPoint localPosition() const override;
/// Return the 3-dimensional local position.
/// The average theLeftHit/theRightHit hits position, namely the wire position
/// is returned.
LocalPoint localPosition() const override;

/// Return the 3-dimensional error on the local position.
/// The error is defiened as half
/// the distance between theLeftHit and theRightHit pos
LocalError localPositionError() const override;
/// Return the 3-dimensional error on the local position.
/// The error is defiened as half
/// the distance between theLeftHit and theRightHit pos
LocalError localPositionError() const override;

/// Access to component RecHits.
/// Return the two recHits (L/R)
std::vector<const TrackingRecHit*> recHits() const override;
/// Access to component RecHits.
/// Return the two recHits (L/R)
std::vector<const TrackingRecHit*> recHits() const override;

/// Non-const access to component RecHits.
/// Return the two recHits (L/R)
std::vector<TrackingRecHit*> recHits() override;
/// Non-const access to component RecHits.
/// Return the two recHits (L/R)
std::vector<TrackingRecHit*> recHits() override;

/// Return the detId of the Det (a DTLayer).
virtual DetId geographicalId() const;
/// Return the detId of the Det (a DTLayer).
virtual DetId geographicalId() const;

/// Return the digi time (ns) used to build the rechits
float digiTime() const { return theLeftHit.digiTime(); }
/// Return the digi time (ns) used to build the rechits
float digiTime() const { return theLeftHit.digiTime(); }

/// Comparison operator, based on the wireId and the digi time
bool operator==(const DTRecHit1DPair& hit) const;
/// Comparison operator, based on the wireId and the digi time
bool operator==(const DTRecHit1DPair& hit) const;

/// Inequality operator, defined as the mirror image of the comparions
/// operator
bool operator!=(const DTRecHit1DPair& hit) const { return !(*this == hit); }
/// Inequality operator, defined as the mirror image of the comparions
/// operator
bool operator!=(const DTRecHit1DPair& hit) const { return !(*this == hit); }

/// Return position in the local (layer) coordinate system for a
/// certain hypothesis about the L/R cell side
LocalPoint localPosition(DTEnums::DTCellSide lrside) const;
/// Return position in the local (layer) coordinate system for a
/// certain hypothesis about the L/R cell side
LocalPoint localPosition(DTEnums::DTCellSide lrside) const;

/// Return position error in the local (layer) coordinate system for a
/// certain hypothesis about the L/R cell side
LocalError localPositionError(DTEnums::DTCellSide lrside) const;
/// Return position error in the local (layer) coordinate system for a
/// certain hypothesis about the L/R cell side
LocalError localPositionError(DTEnums::DTCellSide lrside) const;

/// Set the 3-dimensional local position for the component hit
/// corresponding to the given cell side. Default value is assumed for the error.
void setPosition(DTEnums::DTCellSide lrside, const LocalPoint& point);
/// Set the 3-dimensional local position for the component hit
/// corresponding to the given cell side. Default value is assumed for the error.
void setPosition(DTEnums::DTCellSide lrside, const LocalPoint& point);

/// Set the 3-dimensional local position and error for the component hit
/// corresponding to the given cell side. Default value is assumed for the error.
void setPositionAndError(DTEnums::DTCellSide lrside, const LocalPoint& point, const LocalError& err);
/// Set the 3-dimensional local position and error for the component hit
/// corresponding to the given cell side. Default value is assumed for the error.
void setPositionAndError(DTEnums::DTCellSide lrside, const LocalPoint& point, const LocalError& err);

// Return the wireId
DTWireId wireId() const { return theLeftHit.wireId(); }
// Return the wireId
DTWireId wireId() const { return theLeftHit.wireId(); }

/// Return the left/right DTRecHit1D
const DTRecHit1D* componentRecHit(DTEnums::DTCellSide lrSide) const;
/// Return the left/right DTRecHit1D
const DTRecHit1D* componentRecHit(DTEnums::DTCellSide lrSide) const;

/// Get the left and right 1D rechits (first and second respectively).
std::pair<const DTRecHit1D*, const DTRecHit1D*> componentRecHits() const;
/// Get the left and right 1D rechits (first and second respectively).
std::pair<const DTRecHit1D*, const DTRecHit1D*> componentRecHits() const;

private:
/// Non const access to left/right DTRecHit1D
DTRecHit1D* componentRecHit(DTEnums::DTCellSide lrSide);
private:
/// Non const access to left/right DTRecHit1D
DTRecHit1D* componentRecHit(DTEnums::DTCellSide lrSide);

// The two rechits
DTRecHit1D theLeftHit;
DTRecHit1D theRightHit;
};

/// Ostream operator
std::ostream& operator<<(std::ostream& os, const DTRecHit1DPair& hit);
// The two rechits
DTRecHit1D theLeftHit;
DTRecHit1D theRightHit;
};

/// Ostream operator
std::ostream& operator<<(std::ostream& os, const DTRecHit1DPair& hit);
} // namespace io_v1
using DTRecHit1DPair = io_v1::DTRecHit1DPair;
#endif
Loading