00001 #ifndef TBPositionCalc_h 00002 #define TBPositionCalc_h 00003 00004 #include "CLHEP/Vector/ThreeVector.h" 00005 #include "CLHEP/Vector/Rotation.h" 00006 #include "Rtypes.h" 00007 00008 #include <fstream> 00009 #include <vector> 00010 #include <cmath> 00011 #include <map> 00012 00013 #include "DataFormats/EcalRecHit/interface/EcalRecHit.h" 00014 #include "DataFormats/EcalRecHit/interface/EcalRecHitCollections.h" 00015 #include "DataFormats/EcalDetId/interface/EBDetId.h" 00016 #include "DataFormats/Math/interface/Point3D.h" 00017 #include "Geometry/CaloGeometry/interface/CaloSubdetectorGeometry.h" 00018 #include "Geometry/CaloGeometry/interface/CaloCellGeometry.h" 00019 #include "Geometry/CaloGeometry/interface/TruncatedPyramid.h" 00020 #include "Geometry/EcalTestBeam/interface/EcalTBCrystalMap.h" 00021 00022 #include "FWCore/MessageLogger/interface/MessageLogger.h" 00023 00024 00025 class TBPositionCalc 00026 { 00027 public: 00028 00029 TBPositionCalc(std::map<std::string,double> providedParameters, const std::string& mapFile, const CaloSubdetectorGeometry *passedGeometry); 00030 00031 TBPositionCalc() { }; 00032 00033 ~TBPositionCalc(); 00034 00035 Hep3Vector CalculateTBPos(std::vector<EBDetId> passedDetIds, int myCrystal, EcalRecHitCollection const *passedRecHitsMap); 00036 00037 Hep3Vector CalculateCMSPos(std::vector<EBDetId> passedDetIds, int myCrystal, EcalRecHitCollection const *passedRecHitsMap); 00038 00039 void computeRotation(int myCrystal, HepRotation & CMStoTB ); 00040 00041 00042 private: 00043 bool param_LogWeighted_; 00044 Double32_t param_X0_; 00045 Double32_t param_T0_; 00046 Double32_t param_W0_; 00047 00048 EcalTBCrystalMap * theTestMap; 00049 00050 const CaloSubdetectorGeometry *theGeometry_; 00051 }; 00052 00053 #endif 00054 00055