-
Notifications
You must be signed in to change notification settings - Fork 20
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support for PandoraPFA on ALLEGRO #31
base: master
Are you sure you want to change the base?
Changes from 5 commits
9df817f
b884d48
bd2e2e2
4633625
6e40bc7
2edf63b
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,111 @@ | ||
/** | ||
* @file DDMarlinPandora/include/DDCaloHitCreatorALLEGRO.h | ||
* | ||
* @brief Header file for the calo hit creator class. | ||
* | ||
* $Log: $ | ||
*/ | ||
|
||
#ifndef DDCALO_HIT_CREATORALLEGRO_H | ||
#define DDCALO_HIT_CREATORALLEGRO_H 1 | ||
|
||
#include "EVENT/CalorimeterHit.h" | ||
#include "EVENT/LCEvent.h" | ||
|
||
#include <IMPL/CalorimeterHitImpl.h> | ||
|
||
#include "Api/PandoraApi.h" | ||
|
||
#include <DDRec/DetectorData.h> | ||
#include <DD4hep/Detector.h> | ||
#include <DD4hep/DetElement.h> | ||
|
||
#include "DDCaloHitCreator.h" | ||
|
||
|
||
/** | ||
* @brief DDCaloHitCreator class | ||
*/ | ||
class DDCaloHitCreatorALLEGRO : public DDCaloHitCreator | ||
{ | ||
public: | ||
typedef std::vector<std::string> StringVector; | ||
typedef std::vector<float> FloatVector; | ||
|
||
/** | ||
* @brief Constructor | ||
* | ||
* @param settings the creator settings | ||
* @param pPandora address of the relevant pandora instance | ||
*/ | ||
DDCaloHitCreatorALLEGRO(const Settings &settings, const pandora::Pandora *const pPandora); | ||
|
||
/** | ||
* @brief Destructor | ||
*/ | ||
~DDCaloHitCreatorALLEGRO(); | ||
|
||
/** | ||
* @brief Create calo hits | ||
* | ||
* @param pLCEvent the lcio event | ||
*/ | ||
pandora::StatusCode CreateCaloHits(const EVENT::LCEvent *const pLCEvent); | ||
|
||
private: | ||
/** | ||
* @brief Get common calo hit properties: position, parent address, input energy and time | ||
* | ||
* @param pCaloHit the lcio calorimeter hit | ||
* @param caloHitParameters the calo hit parameters to populate | ||
*/ | ||
void GetCommonCaloHitProperties(const EVENT::CalorimeterHit *const pCaloHit, PandoraApi::CaloHit::Parameters &caloHitParameters) const; | ||
|
||
/** | ||
* @brief Get end cap specific calo hit properties: cell size, absorber radiation and interaction lengths, normal vector | ||
* | ||
* @param pCaloHit the lcio calorimeter hit | ||
* @param layers the vector of layers from DDRec extensions | ||
* @param caloHitParameters the calo hit parameters to populate | ||
* @param absorberCorrection to receive the absorber thickness correction for the mip equivalent energy | ||
*/ | ||
void GetEndCapCaloHitProperties(const EVENT::CalorimeterHit *const pCaloHit, const std::vector<dd4hep::rec::LayeredCalorimeterStruct::Layer> &layers, | ||
PandoraApi::CaloHit::Parameters &caloHitParameters, float &absorberCorrection) const; | ||
|
||
/** | ||
* @brief Get barrel specific calo hit properties: cell size, absorber radiation and interaction lengths, normal vector | ||
* | ||
* @param pCaloHit the lcio calorimeter hit | ||
* @param layers the vector of layers from DDRec extensions | ||
* @param barrelSymmetryOrder the barrel order of symmetry | ||
* @param caloHitParameters the calo hit parameters to populate | ||
* @param normalVector is the normalVector to the sensitive layers in local coordinates | ||
* @param absorberCorrection to receive the absorber thickness correction for the mip equivalent energy | ||
*/ | ||
void GetBarrelCaloHitProperties( const EVENT::CalorimeterHit *const pCaloHit, | ||
const std::vector<dd4hep::rec::LayeredCalorimeterStruct::Layer> &layers, | ||
unsigned int barrelSymmetryOrder, | ||
PandoraApi::CaloHit::Parameters &caloHitParameters, | ||
FloatVector const& normalVector, | ||
float &absorberCorrection ) const; | ||
|
||
/** | ||
* @brief Get number of active layers from position of a calo hit to the edge of the detector | ||
* | ||
* @param pCaloHit the lcio calorimeter hit | ||
*/ | ||
int GetNLayersFromEdge(const EVENT::CalorimeterHit *const pCaloHit) const; | ||
|
||
/** | ||
* @brief Get the maximum radius of a calo hit in a polygonal detector structure | ||
* | ||
* @param pCaloHit the lcio calorimeter hit | ||
* @param symmetryOrder the symmetry order | ||
* @param phi0 the angular orientation | ||
* | ||
* @return the maximum radius | ||
*/ | ||
float GetMaximumRadius(const EVENT::CalorimeterHit *const pCaloHit, const unsigned int symmetryOrder, const float phi0) const; | ||
|
||
}; | ||
#endif // #ifndef CALO_HIT_CREATOR_H |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
/** | ||
* @file DDMarlinPandora/include/DDGeometryCreatorALLEGRO.h | ||
* | ||
* @brief Header file for the geometry creator class. | ||
* | ||
* $Log: $ | ||
*/ | ||
|
||
#ifndef DDGEOMETRYALLEGRO_CREATOR_H | ||
#define DDGEOMETRYALLEGRO_CREATOR_H 1 | ||
|
||
#include "Api/PandoraApi.h" | ||
|
||
#include "DDRec/DetectorData.h" | ||
#include "DDGeometryCreator.h" | ||
|
||
//------------------------------------------------------------------------------------------------------------------------------------------ | ||
|
||
/** | ||
* @brief DDGeometryCreator class | ||
*/ | ||
class DDGeometryCreatorALLEGRO : public DDGeometryCreator | ||
{ | ||
public: | ||
/** | ||
* @brief Constructor | ||
* | ||
* @param settings the creator settings | ||
* @param pPandora address of the relevant pandora instance | ||
*/ | ||
DDGeometryCreatorALLEGRO(const Settings &settings, const pandora::Pandora *const pPandora); | ||
|
||
/** | ||
* @brief Destructor | ||
*/ | ||
~DDGeometryCreatorALLEGRO(); | ||
|
||
/** | ||
* @brief Create geometry | ||
*/ | ||
pandora::StatusCode CreateGeometry() const; | ||
|
||
private: | ||
/** | ||
* @brief Set mandatory sub detector parameters | ||
* | ||
* @param subDetectorTypeMap the sub detector type map | ||
*/ | ||
void SetMandatorySubDetectorParameters(SubDetectorTypeMap &subDetectorTypeMap) const; | ||
|
||
}; | ||
|
||
#endif // #ifndef GEOMETRY_CREATOR_H |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,110 @@ | ||
/** | ||
* @file DDMarlinPandora/include/DDTrackCreatorALLEGRO.h | ||
* | ||
* @brief Header file for the ILD implementation of the track creator class. | ||
* | ||
* $Log: $ | ||
*/ | ||
|
||
#ifndef DDTRACK_CREATOR_ALLEGRO_H | ||
#define DDTRACK_CREATOR_ALLEGRO_H 1 | ||
|
||
#include "DDTrackCreatorBase.h" | ||
|
||
//------------------------------------------------------------------------------------------------------------------------------------------ | ||
|
||
/** | ||
* @brief DDTrackCreatorALLEGRO class | ||
*/ | ||
class DDTrackCreatorALLEGRO : public DDTrackCreatorBase | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why not inherit from DDTrackCreatorCLIC and reduce the amount of copy-pasta? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The functions re-used in the DDTrackCreatorALLEGRO are supposed to change for ALLEGRO. Currently only few things are disabled, but implementation of the (truth) tracks in the ALLEGRO is not finished yet. |
||
{ | ||
public: | ||
|
||
/** | ||
* @brief Constructor | ||
* | ||
* @param settings the creator settings | ||
* @param pPandora address of the relevant pandora instance | ||
*/ | ||
DDTrackCreatorALLEGRO(const Settings &settings, const pandora::Pandora *const pPandora); | ||
|
||
/** | ||
* @brief Destructor | ||
*/ | ||
virtual ~DDTrackCreatorALLEGRO(); | ||
|
||
/** | ||
* @brief Create tracks implementation, insert user code here. Detector specific | ||
* | ||
* @param pLCEvent the lcio event | ||
*/ | ||
pandora::StatusCode CreateTracks(EVENT::LCEvent *pLCEvent); | ||
|
||
|
||
|
||
protected: | ||
|
||
|
||
//Detector-specific configuration variables | ||
float m_trackerInnerR; ///< Inner radius of the barrel tracker | ||
float m_trackerOuterR; ///< Outer radius of the barrel tracker | ||
float m_trackerZmax; ///< max extent of the tracker along z | ||
float m_cosTracker; | ||
|
||
DoubleVector m_endcapDiskInnerRadii; ///< List of endcapDisk inner radii | ||
DoubleVector m_endcapDiskOuterRadii; ///< List of endcapDisk outer radii | ||
DoubleVector m_endcapDiskZPositions; ///< List of endcapDisk z positions | ||
unsigned int m_nEndcapDiskLayers; ///< Number of endcapDisk layers | ||
unsigned int m_barrelTrackerLayers; ///< Number of barrel tracker layers | ||
|
||
float m_tanLambdaEndcapDisk; ///< Tan lambda for first endcapDisk layer | ||
|
||
/** | ||
* @brief Whether track passes the quality cuts required in order to be used to form a pfo. Detector specific | ||
* | ||
* @param pTrack the lcio track | ||
* @param trackParameters the track parameters | ||
* | ||
* @return boolean | ||
*/ | ||
|
||
virtual bool PassesQualityCuts(const EVENT::Track *const pTrack, const PandoraApi::Track::Parameters &trackParameters) const; | ||
|
||
/** | ||
* @brief Decide whether track reaches the ecal surface. Detector specific | ||
* | ||
* @param pTrack the lcio track | ||
* @param trackParameters the track parameters | ||
*/ | ||
virtual void TrackReachesECAL(const EVENT::Track *const pTrack, PandoraApi::Track::Parameters &trackParameters) const; | ||
|
||
/** | ||
* @brief Determine whether a track can be used to form a pfo under the following conditions: | ||
* 1) if the track proves to be associated with a cluster, OR | ||
* 2) if the track proves to have no cluster associations | ||
* Detector specific | ||
* | ||
* @param pTrack the lcio track | ||
* @param trackParameters the track parameters | ||
*/ | ||
virtual void DefineTrackPfoUsage(const EVENT::Track *const pTrack, PandoraApi::Track::Parameters &trackParameters) const; | ||
|
||
/** | ||
* @brief Copy track states stored in lcio tracks to pandora track parameters | ||
* | ||
* @param pTrack the lcio track | ||
* @param trackParameters the track parameters | ||
*/ | ||
// void GetTrackStates(const EVENT::Track *const pTrack, PandoraApi::Track::Parameters &trackParameters) const; | ||
|
||
/** | ||
* @brief Obtain track time when it reaches ECAL | ||
* | ||
* @param pTrack the lcio track | ||
*/ | ||
// float CalculateTrackTimeAtCalorimeter(const EVENT::Track *const pTrack) const; | ||
}; | ||
|
||
|
||
|
||
#endif // #ifndef DDTRACK_CREATOR_ALLEGRO_H |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should rather make the private entries protected. And make some functions virtual when they are overridden in the inherited class.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done as suggested, for DDCaloHitCreator as well.