Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-31 09:21:50

0001 //
0002 // ********************************************************************
0003 // * License and Disclaimer                                           *
0004 // *                                                                  *
0005 // * The  Geant4 software  is  copyright of the Copyright Holders  of *
0006 // * the Geant4 Collaboration.  It is provided  under  the terms  and *
0007 // * conditions of the Geant4 Software License,  included in the file *
0008 // * LICENSE and available at  http://cern.ch/geant4/license .  These *
0009 // * include a list of copyright holders.                             *
0010 // *                                                                  *
0011 // * Neither the authors of this software system, nor their employing *
0012 // * institutes,nor the agencies providing financial support for this *
0013 // * work  make  any representation or  warranty, express or implied, *
0014 // * regarding  this  software system or assume any liability for its *
0015 // * use.  Please see the license in the file  LICENSE  and URL above *
0016 // * for the full disclaimer and the limitation of liability.         *
0017 // *                                                                  *
0018 // * This  code  implementation is the result of  the  scientific and *
0019 // * technical work of the GEANT4 collaboration.                      *
0020 // * By using,  copying,  modifying or  distributing the software (or *
0021 // * any work based  on the software)  you  agree  to acknowledge its *
0022 // * use  in  resulting  scientific  publications,  and indicate your *
0023 // * acceptance of all terms of the Geant4 Software license.          *
0024 // ********************************************************************
0025 //
0026 /*
0027  * =============================================================================
0028  *
0029  *       Filename:  CexmcReconstructor.hh
0030  *
0031  *    Description:  reconstructor base class
0032  *
0033  *        Version:  1.0
0034  *        Created:  02.12.2009 15:44:12
0035  *       Revision:  none
0036  *       Compiler:  gcc
0037  *
0038  *         Author:  Alexey Radkov (), 
0039  *        Company:  PNPI
0040  *
0041  * =============================================================================
0042  */
0043 
0044 #ifndef CEXMC_RECONSTRUCTOR_HH
0045 #define CEXMC_RECONSTRUCTOR_HH
0046 
0047 #include <G4ThreeVector.hh>
0048 #include <G4AffineTransform.hh>
0049 #include "CexmcSetup.hh"
0050 #include "CexmcCommon.hh"
0051 
0052 class  CexmcReconstructorMessenger;
0053 struct  CexmcEnergyDepositStore;
0054 
0055 
0056 class  CexmcReconstructor
0057 {
0058     public:
0059         explicit CexmcReconstructor();
0060 
0061         virtual ~CexmcReconstructor();
0062 
0063     public:
0064         virtual void  Reconstruct( const CexmcEnergyDepositStore *  edStore );
0065 
0066     public:
0067         void  SetCalorimeterEntryPointDefinitionAlgorithm(
0068                     CexmcCalorimeterEntryPointDefinitionAlgorithm  algo );
0069 
0070         void  SetCalorimeterEntryPointDepthDefinitionAlgorithm(
0071                     CexmcCalorimeterEntryPointDepthDefinitionAlgorithm  algo );
0072 
0073         void  SetCrystalSelectionAlgorithm(
0074                     CexmcCrystalSelectionAlgorithm  algo );
0075 
0076         void  UseInnerRefCrystal( G4bool  on = true );
0077 
0078         void  SetCalorimeterEntryPointDepth( G4double  depth );
0079 
0080         CexmcCalorimeterEntryPointDefinitionAlgorithm
0081                     GetCalorimeterEntryPointDefinitionAlgorithm( void ) const;
0082 
0083         CexmcCalorimeterEntryPointDepthDefinitionAlgorithm
0084                 GetCalorimeterEntryPointDepthDefinitionAlgorithm( void ) const;
0085 
0086         CexmcCrystalSelectionAlgorithm
0087                     GetCrystalSelectionAlgorithm( void ) const;
0088 
0089         G4bool    IsInnerRefCrystalUsed( void ) const;
0090 
0091         G4double  GetCalorimeterEntryPointDepth( void ) const;
0092 
0093     public:
0094         const G4ThreeVector &  GetCalorimeterEPLeftPosition( void ) const;
0095 
0096         const G4ThreeVector &  GetCalorimeterEPRightPosition( void ) const;
0097 
0098         const G4ThreeVector &  GetCalorimeterEPLeftDirection( void ) const;
0099 
0100         const G4ThreeVector &  GetCalorimeterEPRightDirection( void ) const;
0101 
0102         const G4ThreeVector &  GetTargetEPPosition( void ) const;
0103 
0104         const G4ThreeVector &  GetTargetEPDirection( void ) const;
0105 
0106         const G4ThreeVector &  GetCalorimeterEPLeftWorldPosition( void ) const;
0107 
0108         const G4ThreeVector &  GetCalorimeterEPRightWorldPosition( void ) const;
0109 
0110         const G4ThreeVector &  GetCalorimeterEPLeftWorldDirection( void ) const;
0111 
0112         const G4ThreeVector &  GetCalorimeterEPRightWorldDirection( void )
0113                                                                         const;
0114 
0115         const G4ThreeVector &  GetTargetEPWorldPosition( void ) const;
0116 
0117         const G4ThreeVector &  GetTargetEPWorldDirection( void ) const;
0118 
0119         G4double               GetTheAngle( void ) const;
0120 
0121     public:
0122         G4bool                 HasBasicTrigger( void ) const;
0123 
0124         virtual G4bool         HasFullTrigger( void ) const;
0125 
0126     protected:
0127         void                   ReconstructEntryPoints(
0128                                     const CexmcEnergyDepositStore *  edStore );
0129 
0130         void                   ReconstructTargetPoint( void );
0131 
0132         void                   ReconstructAngle( void );
0133 
0134     private:
0135         void  CollectEDInAdjacentCrystals(
0136                 const CexmcEnergyDepositCalorimeterCollection &  edHits,
0137                 G4int  row, G4int  column, G4double &  ed );
0138 
0139         void  CalculateWeightedEPPosition(
0140                 const CexmcEnergyDepositCalorimeterCollection &  edHits,
0141                 G4int  row, G4int  column, G4double &  x, G4double &  y,
0142                 G4double &  ed );
0143 
0144         void  TransformToAdjacentInnerCrystal( G4int &  column,
0145                                                G4int &  row ) const;
0146 
0147     protected:
0148         G4bool                               hasBasicTrigger;
0149 
0150     protected:
0151         CexmcCalorimeterEntryPointDefinitionAlgorithm  epDefinitionAlgorithm;
0152 
0153         CexmcCalorimeterEntryPointDepthDefinitionAlgorithm
0154                                                     epDepthDefinitionAlgorithm;
0155 
0156         CexmcCrystalSelectionAlgorithm       csAlgorithm;
0157 
0158         G4bool                               useInnerRefCrystal;
0159 
0160         G4double                             epDepth;
0161 
0162     protected:
0163         G4ThreeVector                        calorimeterEPLeftPosition;
0164 
0165         G4ThreeVector                        calorimeterEPRightPosition;
0166 
0167         G4ThreeVector                        calorimeterEPLeftDirection;
0168 
0169         G4ThreeVector                        calorimeterEPRightDirection;
0170 
0171         G4ThreeVector                        targetEPPosition;
0172 
0173         G4ThreeVector                        targetEPDirection;
0174 
0175         G4ThreeVector                        calorimeterEPLeftWorldPosition;
0176 
0177         G4ThreeVector                        calorimeterEPRightWorldPosition;
0178 
0179         G4ThreeVector                        calorimeterEPLeftWorldDirection;
0180 
0181         G4ThreeVector                        calorimeterEPRightWorldDirection;
0182 
0183         G4ThreeVector                        targetEPWorldPosition;
0184 
0185         G4ThreeVector                        targetEPWorldDirection;
0186 
0187         G4double                             theAngle;
0188 
0189     protected:
0190         G4double                             calorimeterEDLeftAdjacent;
0191 
0192         G4double                             calorimeterEDRightAdjacent;
0193 
0194         G4bool                               collectEDInAdjacentCrystals;
0195 
0196     private:
0197         CexmcSetup::CalorimeterGeometryData  calorimeterGeometry;
0198 
0199         G4AffineTransform                    calorimeterLeftTransform;
0200         
0201         G4AffineTransform                    calorimeterRightTransform;
0202 
0203         G4AffineTransform                    targetTransform;
0204 
0205         G4bool                               targetEPInitialized;
0206 
0207     private:
0208         CexmcReconstructorMessenger *        messenger;
0209 };
0210 
0211 
0212 inline void  CexmcReconstructor::SetCalorimeterEntryPointDefinitionAlgorithm(
0213                         CexmcCalorimeterEntryPointDefinitionAlgorithm  algo )
0214 {
0215     epDefinitionAlgorithm = algo;
0216 }
0217 
0218 
0219 inline void
0220         CexmcReconstructor::SetCalorimeterEntryPointDepthDefinitionAlgorithm(
0221                     CexmcCalorimeterEntryPointDepthDefinitionAlgorithm  algo )
0222 {
0223     epDepthDefinitionAlgorithm = algo;
0224 }
0225 
0226 
0227 inline void  CexmcReconstructor::SetCrystalSelectionAlgorithm(
0228                                         CexmcCrystalSelectionAlgorithm  algo )
0229 {
0230     csAlgorithm = algo;
0231 }
0232 
0233 
0234 inline void  CexmcReconstructor::UseInnerRefCrystal( G4bool  on )
0235 {
0236     useInnerRefCrystal = on;
0237 }
0238 
0239 
0240 inline void  CexmcReconstructor::SetCalorimeterEntryPointDepth(
0241                                                             G4double  depth )
0242 {
0243     epDepth = depth;
0244 }
0245 
0246 
0247 inline CexmcCalorimeterEntryPointDefinitionAlgorithm
0248         CexmcReconstructor::GetCalorimeterEntryPointDefinitionAlgorithm( void )
0249                                                                         const
0250 {
0251     return epDefinitionAlgorithm;
0252 }
0253 
0254 
0255 inline CexmcCalorimeterEntryPointDepthDefinitionAlgorithm
0256         CexmcReconstructor::GetCalorimeterEntryPointDepthDefinitionAlgorithm(
0257                                                                     void ) const
0258 {
0259     return epDepthDefinitionAlgorithm;
0260 }
0261 
0262 
0263 inline CexmcCrystalSelectionAlgorithm
0264                 CexmcReconstructor::GetCrystalSelectionAlgorithm( void ) const
0265 {
0266     return csAlgorithm;
0267 }
0268 
0269 
0270 inline G4bool  CexmcReconstructor::IsInnerRefCrystalUsed( void ) const
0271 {
0272     return useInnerRefCrystal;
0273 }
0274 
0275 
0276 inline G4double  CexmcReconstructor::GetCalorimeterEntryPointDepth( void ) const
0277 {
0278     return epDepth;
0279 }
0280 
0281 
0282 inline const G4ThreeVector &
0283                 CexmcReconstructor::GetCalorimeterEPLeftPosition( void ) const
0284 {
0285     return calorimeterEPLeftPosition;
0286 }
0287 
0288 
0289 inline const G4ThreeVector &
0290                 CexmcReconstructor::GetCalorimeterEPRightPosition( void ) const
0291 {
0292     return calorimeterEPRightPosition;
0293 }
0294 
0295 
0296 inline const G4ThreeVector &
0297                 CexmcReconstructor::GetCalorimeterEPLeftDirection( void ) const
0298 {
0299     return calorimeterEPLeftDirection;
0300 }
0301 
0302 
0303 inline const G4ThreeVector &
0304                 CexmcReconstructor::GetCalorimeterEPRightDirection( void ) const
0305 {
0306     return calorimeterEPRightDirection;
0307 }
0308 
0309 
0310 inline const G4ThreeVector &
0311                 CexmcReconstructor::GetTargetEPPosition( void ) const
0312 {
0313     return targetEPPosition;
0314 }
0315 
0316 
0317 inline const G4ThreeVector &
0318                 CexmcReconstructor::GetTargetEPDirection( void ) const
0319 {
0320     return targetEPDirection;
0321 }
0322 
0323 
0324 inline const G4ThreeVector &
0325         CexmcReconstructor::GetCalorimeterEPLeftWorldPosition( void ) const
0326 {
0327     return calorimeterEPLeftWorldPosition;
0328 }
0329 
0330 
0331 inline const G4ThreeVector &
0332         CexmcReconstructor::GetCalorimeterEPRightWorldPosition( void ) const
0333 {
0334     return calorimeterEPRightWorldPosition;
0335 }
0336 
0337 
0338 inline const G4ThreeVector &
0339         CexmcReconstructor::GetCalorimeterEPLeftWorldDirection( void ) const
0340 {
0341     return calorimeterEPLeftWorldDirection;
0342 }
0343 
0344 
0345 inline const G4ThreeVector &
0346         CexmcReconstructor::GetCalorimeterEPRightWorldDirection( void ) const
0347 {
0348     return calorimeterEPRightWorldDirection;
0349 }
0350 
0351 
0352 inline const G4ThreeVector &
0353         CexmcReconstructor::GetTargetEPWorldPosition( void ) const
0354 {
0355     return targetEPWorldPosition;
0356 }
0357 
0358 
0359 inline const G4ThreeVector &
0360         CexmcReconstructor::GetTargetEPWorldDirection( void ) const
0361 {
0362     return targetEPWorldDirection;
0363 }
0364 
0365 
0366 inline G4double  CexmcReconstructor::GetTheAngle( void ) const
0367 {
0368     return theAngle;
0369 }
0370 
0371 
0372 inline G4bool  CexmcReconstructor::HasBasicTrigger( void ) const
0373 {
0374     return hasBasicTrigger;
0375 }
0376 
0377 
0378 inline void  CexmcReconstructor::TransformToAdjacentInnerCrystal(
0379                                         G4int &  column, G4int &  row ) const
0380 {
0381     if ( column == 0 )
0382         ++column;
0383     if ( column == calorimeterGeometry.nCrystalsInRow - 1 )
0384         --column;
0385     if ( row == 0 )
0386         ++row;
0387     if ( row == calorimeterGeometry.nCrystalsInColumn - 1 )
0388         --row;
0389 }
0390 
0391 
0392 #endif
0393