CMS 3D CMS Logo

SiStripClusterInfo.h

Go to the documentation of this file.
00001 
00002 #ifndef ANALYSISDATAFORMATS_SISTRIPCLUSTERINFO_H
00003 #define ANALYSISDATAFORMATS_SISTRIPCLUSTERINFO_H
00004 // -*- C++ -*-
00005 //
00006 // Package:     AnalysisDataFormats
00007 // Class  :     SiStripClusterInfo
00008 // 
00015 //
00016 // Original Author:  Evelyne Delmeire
00017 //         Created:  Sun Jan 27 16:07:51 CET 2007
00018 //
00019 #include "FWCore/Framework/interface/EventSetup.h"
00020 #include "FWCore/Framework/interface/ESHandle.h"
00021 
00022 #include "DataFormats/Common/interface/DetSet.h"
00023 #include "DataFormats/Common/interface/DetSetVector.h"
00024 #include "DataFormats/Common/interface/DetSetNew.h"
00025 #include "DataFormats/Common/interface/DetSetVectorNew.h"
00026 #include "DataFormats/SiStripCluster/interface/SiStripCluster.h"
00027 
00028 #include "CondFormats/SiStripObjects/interface/SiStripPedestals.h"
00029 #include "CondFormats/SiStripObjects/interface/SiStripNoises.h"
00030 
00031 #include "CalibFormats/SiStripObjects/interface/SiStripGain.h"
00032 
00033 #include "CommonTools/SiStripZeroSuppression/interface/SiStripPedestalsSubtractor.h"
00034 #include "CommonTools/SiStripZeroSuppression/interface/SiStripCommonModeNoiseSubtractor.h"
00035 
00036 #include <vector>
00037 #include <sstream>
00038 #include <string>
00039 #include "boost/cstdint.hpp"
00040 
00041 class SiStripRawDigi;
00042 
00043 class SiStripDigi;
00044 
00045 class SiStripClusterInfo {
00046   
00047  public:
00048   
00049   // constructor with the detid (in case it will be eliminated from the SiStripCluster)
00050   SiStripClusterInfo(const uint32_t cluster_detId,
00051                      const SiStripCluster& cluster, 
00052                      const edm::EventSetup& es, 
00053                      std::string CMNSubtractionMode="Median");
00054   
00055   // constructor without the detid (taken from SiStripCluster)
00056   SiStripClusterInfo(const SiStripCluster& cluster, 
00057                      const edm::EventSetup& es, 
00058                      std::string CMNSubtractionMode="Median");
00059   
00060   ~SiStripClusterInfo();
00061     
00063   uint32_t getDetId() const {return cluster_detId_;};
00064   
00066   uint16_t                           getFirstStrip() const {return cluster_->firstStrip();}
00068   float                                getPosition() const {return cluster_->barycenter();}
00070   const std::vector<uint8_t>&  getStripAmplitudes() const {return cluster_->amplitudes();} 
00071   
00072   
00074   float                                   getWidth() const {return cluster_->amplitudes().size();}
00076   float                                  getCharge() const;
00079   uint16_t                          getMaxPosition() const;
00082   uint16_t                          getMaxPosition(const SiStripCluster*) const;
00084   float                               getMaxCharge() const;  
00086   std::pair<float,float>               getChargeLR() const;
00088   std::pair<float,float> getChargeLRFirstNeighbour() const;
00089   //
00091   std::vector<float> getRawChargeCLR( const edm::DetSet<SiStripRawDigi>&,
00092                                       edmNew::DetSet<SiStripCluster>&,
00093                                       std::string );
00094   
00095   
00097   std::vector<float>               getStripNoises() const; 
00099   std::vector<float> getStripNoisesRescaledByGain() const; 
00101   float                                  getNoise()  ;
00103   float                    getNoiseRescaledByGain()  ;
00105   float                        getNoiseForStripNb(uint16_t istrip ) const;
00106   
00108   std::vector<float> getApvGains() const; 
00110   float        getGainForStripNb(uint16_t istrip ) const;
00111   
00113   float               getSignalOverNoise() ;
00115   float getSignalOverNoiseRescaledByGain() ;
00116 
00117   
00119   std::pair< std::vector<float>,std::vector<float> > getRawDigiAmplitudesLR(      uint32_t&                          neighbourStripNr, 
00120                                                                             const edm::DetSetVector<SiStripRawDigi>&    rawDigis_dsv_, 
00121                                                                                   edmNew::DetSetVector<SiStripCluster>& clusters_dsv_,
00122                                                                                   std::string                           rawDigiLabel);
00123 
00125   std::pair< std::vector<float>,std::vector<float> > getRawDigiAmplitudesLR(      uint32_t&                   neighbourStripNr, 
00126                                                                             const edm::DetSet<SiStripRawDigi>&    rawDigis_ds_, 
00127                                                                                   edmNew::DetSet<SiStripCluster>& clusters_ds_,
00128                                                                                   std::string                     rawDigiLabel); 
00129 
00130 
00131   
00133   std::pair< std::vector<float>,std::vector<float> >  getDigiAmplitudesLR(      uint32_t&                          neighbourStripNr,
00134                                                                           const edm::DetSetVector<SiStripDigi>&          digis_dsv_,
00135                                                                                 edmNew::DetSetVector<SiStripCluster>& clusters_dsv_);
00136 
00138   std::pair< std::vector<float>,std::vector<float> > getDigiAmplitudesLR(      uint32_t&                   neighbourStripNr, 
00139                                                                          const edm::DetSet<SiStripDigi>&          digis_ds_, 
00140                                                                                edmNew::DetSet<SiStripCluster>& clusters_ds_);
00141  
00142 
00143  private:
00144   
00145   
00146   void rawdigi_algorithm(const edm::DetSet<SiStripRawDigi>    rawDigis_ds_,
00147                                edmNew::DetSet<SiStripCluster> clusters_ds_,
00148                                std::string                    rawDigiLabel);
00149   
00150   void digi_algorithm(const edm::DetSet<SiStripDigi>         digis_ds_,
00151                             edmNew::DetSet<SiStripCluster> cluster_ds_);
00152   
00153   void findNeigh(char*                                  mode,
00154                  edmNew::DetSet<SiStripCluster> clusters_ds_,
00155                  std::vector<int16_t>&                  vadc,
00156                  std::vector<int16_t>&                vstrip);
00157  
00158   const edm::EventSetup&      es_; 
00159   edm::ESHandle<SiStripNoises>        noiseHandle_;
00160   edm::ESHandle<SiStripGain>           gainHandle_;
00161   edm::ESHandle<SiStripPedestals> pedestalsHandle_;
00162     
00163   const SiStripCluster *cluster_;
00164   uint32_t cluster_detId_;
00165    
00166   uint32_t neighbourStripNr_;
00167   SiStripCommonModeNoiseSubtractor* SiStripCommonModeNoiseSubtractor_;
00168   std::string CMNSubtractionMode_;
00169   bool validCMNSubtraction_;  
00170   SiStripPedestalsSubtractor* SiStripPedestalsSubtractor_;
00171   float                amplitudeC_;
00172   std::vector<float>   amplitudesL_;
00173   std::vector<float>   amplitudesR_;
00174   
00175 };
00176 
00177 #endif // ANALYSISDATAFORMATS_SISTRIPCLUSTER_H

Generated on Tue Jun 9 17:25:06 2009 for CMSSW by  doxygen 1.5.4