-
Notifications
You must be signed in to change notification settings - Fork 19
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
Open
Archil-AD
wants to merge
5
commits into
iLCSoft:master
Choose a base branch
from
Archil-AD:ALLEGRO
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 3 commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
9df817f
Implementing GeometryCreator and CaloHitCreator for ALLEGRO detector
b884d48
add ALLEGRO tracks
bd2e2e2
enable muon calohit creation in ALLEGRO
4633625
Update src/DDCaloHitCreatorALLEGRO.cc
Archil-AD 6e40bc7
cleaning some duplicate codes for ALLEGRO
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,132 @@ | ||
/** | ||
* @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 Create ecal calo hits | ||
* | ||
* @param pLCEvent the lcio event | ||
*/ | ||
pandora::StatusCode CreateECalCaloHits(const EVENT::LCEvent *const pLCEvent); | ||
|
||
/** | ||
* @brief Create hcal calo hits | ||
* | ||
* @param pLCEvent the lcio event | ||
*/ | ||
pandora::StatusCode CreateHCalCaloHits(const EVENT::LCEvent *const pLCEvent); | ||
|
||
/** | ||
* @brief Create muon calo hits | ||
* | ||
* @param pLCEvent the lcio event | ||
*/ | ||
pandora::StatusCode CreateMuonCaloHits(const EVENT::LCEvent *const pLCEvent); | ||
|
||
/** | ||
* @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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
/** | ||
* @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; | ||
|
||
/** | ||
* @brief Set sub detector parameters to their gear default values | ||
* | ||
* @param inputParameters input parameters, from gear | ||
* @param subDetectorName the sub detector name | ||
* @param subDetectorType the sub detector type | ||
* @param parameters the sub detector parameters | ||
*/ | ||
void SetDefaultSubDetectorParameters(const dd4hep::rec::LayeredCalorimeterData &inputParameters, const std::string &subDetectorName, | ||
const pandora::SubDetectorType subDetectorType, PandoraApi::Geometry::SubDetector::Parameters ¶meters) const; | ||
}; | ||
|
||
#endif // #ifndef GEOMETRY_CREATOR_H |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
{ | ||
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 |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
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 comment
The 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.