CMS 3D CMS Logo

SiStripClusterInfo Class Reference

Description: utility class gathering all access methods to SiStripCluster-related information for detector-related studies and DQM. More...

#include <AnalysisDataFormats/SiStripClusterInfo/interface/SiStripClusterInfo.h>

List of all members.

Public Member Functions

std::vector< float > getApvGains () const
 Vector of APV Gain.
float getCharge () const
 Cluster Charge (Signal).
std::pair< float, float > getChargeLR () const
 Sum of the cluster strip charges Left/Right the Cluster Seed.
std::pair< float, float > getChargeLRFirstNeighbour () const
 Cluster Charge of the first strip Left/Right the Cluster Seed.
uint32_t getDetId () const
 Cluster DetId.
std::pair< std::vector< float >,
std::vector< float > > 
getDigiAmplitudesLR (uint32_t &neighbourStripNr, const edm::DetSet< SiStripDigi > &digis_ds_, edmNew::DetSet< SiStripCluster > &clusters_ds_)
 Vectors of the cluster strip charges Left/Right the Cluster Seed from Digis.
std::pair< std::vector< float >,
std::vector< float > > 
getDigiAmplitudesLR (uint32_t &neighbourStripNr, const edm::DetSetVector< SiStripDigi > &digis_dsv_, edmNew::DetSetVector< SiStripCluster > &clusters_dsv_)
 Vectors of the cluster strip charges Left/Right the Cluster Seed from Digis.
uint16_t getFirstStrip () const
 Cluster First Strip Number (the first strip is 0, this number can be used as index of a vector).
float getGainForStripNb (uint16_t istrip) const
 Strip APV Gain.
float getMaxCharge () const
 Charge of the Strip with maximum charge in the cluster (Cluster Seed).
uint16_t getMaxPosition (const SiStripCluster *) const
 Strip Number of the strip with maximum charge in the cluster (Cluster Seed) (the first strip is 0, this number can be used as index of a vector).
uint16_t getMaxPosition () const
 Strip Number of the strip with maximum charge in the cluster (Cluster Seed) (the first strip is 0, this number can be used as index of a vector).
float getNoise ()
 Cluster Noise.
float getNoiseForStripNb (uint16_t istrip) const
 Strip Noise.
float getNoiseRescaledByGain ()
 Cluster Noise rescaled by APV Gain.
float getPosition () const
 Cluster Position.
std::vector< float > getRawChargeCLR (const edm::DetSet< SiStripRawDigi > &, edmNew::DetSet< SiStripCluster > &, std::string)
 RawDigi Charge (Cluster Seed,First Left Strip,First Right Strip).
std::pair< std::vector< float >,
std::vector< float > > 
getRawDigiAmplitudesLR (uint32_t &neighbourStripNr, const edm::DetSet< SiStripRawDigi > &rawDigis_ds_, edmNew::DetSet< SiStripCluster > &clusters_ds_, std::string rawDigiLabel)
 Vectors of the cluster strip charges Left/Right the Cluster Seed from RawDigis.
std::pair< std::vector< float >,
std::vector< float > > 
getRawDigiAmplitudesLR (uint32_t &neighbourStripNr, const edm::DetSetVector< SiStripRawDigi > &rawDigis_dsv_, edmNew::DetSetVector< SiStripCluster > &clusters_dsv_, std::string rawDigiLabel)
 Vectors of the cluster strip charges Left/Right the Cluster Seed from RawDigis.
float getSignalOverNoise ()
 Cluster Signal-to-Noise ratio (S/N).
float getSignalOverNoiseRescaledByGain ()
 Cluster Signal-to-Noise ratio (S/N) rescaled by APV Gain.
const std::vector< uint8_t > & getStripAmplitudes () const
 Vector of Cluster Strip Charge.
std::vector< float > getStripNoises () const
 Vector of Cluster Strip Noise.
std::vector< float > getStripNoisesRescaledByGain () const
 Vector of Cluster Strip Noise rescaled by APV Gain.
float getWidth () const
 Cluster Width.
 SiStripClusterInfo (const SiStripCluster &cluster, const edm::EventSetup &es, std::string CMNSubtractionMode="Median")
 SiStripClusterInfo (const uint32_t cluster_detId, const SiStripCluster &cluster, const edm::EventSetup &es, std::string CMNSubtractionMode="Median")
 ~SiStripClusterInfo ()

Private Member Functions

void digi_algorithm (const edm::DetSet< SiStripDigi > digis_ds_, edmNew::DetSet< SiStripCluster > cluster_ds_)
void findNeigh (char *mode, edmNew::DetSet< SiStripCluster > clusters_ds_, std::vector< int16_t > &vadc, std::vector< int16_t > &vstrip)
void rawdigi_algorithm (const edm::DetSet< SiStripRawDigi > rawDigis_ds_, edmNew::DetSet< SiStripCluster > clusters_ds_, std::string rawDigiLabel)

Private Attributes

float amplitudeC_
std::vector< float > amplitudesL_
std::vector< float > amplitudesR_
const SiStripClustercluster_
uint32_t cluster_detId_
std::string CMNSubtractionMode_
const edm::EventSetupes_
edm::ESHandle< SiStripGaingainHandle_
uint32_t neighbourStripNr_
edm::ESHandle< SiStripNoisesnoiseHandle_
edm::ESHandle< SiStripPedestalspedestalsHandle_
SiStripCommonModeNoiseSubtractorSiStripCommonModeNoiseSubtractor_
SiStripPedestalsSubtractorSiStripPedestalsSubtractor_
bool validCMNSubtraction_


Detailed Description

Description: utility class gathering all access methods to SiStripCluster-related information for detector-related studies and DQM.

Definition at line 45 of file SiStripClusterInfo.h.


Constructor & Destructor Documentation

SiStripClusterInfo::SiStripClusterInfo ( const uint32_t  cluster_detId,
const SiStripCluster cluster,
const edm::EventSetup es,
std::string  CMNSubtractionMode = "Median" 
)

Definition at line 29 of file SiStripClusterInfo.cc.

References cluster_, cluster_detId_, lat::endl(), gainHandle_, edm::EventSetup::get(), noiseHandle_, pedestalsHandle_, SiStripCommonModeNoiseSubtractor_, SiStripPedestalsSubtractor_, and validCMNSubtraction_.

Referenced by SiStripClusterInfo().

00032                                                                     :
00033   es_(es){
00034   
00035   cluster_ = & cluster;  
00036   cluster_detId_ = cluster_detId;  
00037 
00038   es.get<SiStripPedestalsRcd>().get(pedestalsHandle_);
00039   es.get<SiStripNoisesRcd>().get(noiseHandle_);
00040   es.get<SiStripGainRcd>().get(gainHandle_);
00041   
00042   
00043   SiStripPedestalsSubtractor_ = new SiStripPedestalsSubtractor();
00044     
00045     
00046     
00047   //------------------------
00048   if ( CMNSubtractionMode== "Median") { 
00049     SiStripCommonModeNoiseSubtractor_ = new SiStripMedianCommonModeNoiseSubtraction();
00050     validCMNSubtraction_ = true;
00051   }
00052   else if ( CMNSubtractionMode== "TT6") { 
00053     //FIXME : SiStripCommonModeNoiseSubtractor_ = new SiStripTT6CommonModeNoiseSubtraction(conf.getParameter<double>("CutToAvoidSignal"));
00054     validCMNSubtraction_ = true;
00055   }
00056   else {
00057     edm::LogError("SiStripClusterInfoProducer") << "[SiStripClusterInfoProducer::SiStripClusterInfoProducer] No valid CommonModeNoiseSubtraction Mode selected, possible CMNSubtractionMode: Median or TT6" << std::endl;
00058     validCMNSubtraction_ = false;
00059   } 
00060     
00061   //------------------------
00062     
00063   
00064   
00065 }

SiStripClusterInfo::SiStripClusterInfo ( const SiStripCluster cluster,
const edm::EventSetup es,
std::string  CMNSubtractionMode = "Median" 
)

Definition at line 23 of file SiStripClusterInfo.cc.

References SiStripCluster::geographicalId(), and SiStripClusterInfo().

00025                                                                     : es_(es) {
00026   SiStripClusterInfo(cluster.geographicalId(),cluster,es,CMNSubtractionMode);
00027 }

SiStripClusterInfo::~SiStripClusterInfo (  ) 

Definition at line 68 of file SiStripClusterInfo.cc.

References NULL, SiStripCommonModeNoiseSubtractor_, and SiStripPedestalsSubtractor_.


Member Function Documentation

void SiStripClusterInfo::digi_algorithm ( const edm::DetSet< SiStripDigi digis_ds_,
edmNew::DetSet< SiStripCluster cluster_ds_ 
) [private]

Definition at line 494 of file SiStripClusterInfo.cc.

References edm::DetSet< T >::data, and findNeigh().

Referenced by getDigiAmplitudesLR().

00495                                                                                          {
00496   
00497   std::vector<int16_t> vstrip;
00498   std::vector<int16_t> vadc;
00499   
00500   //Get list of digis for the current DetId
00501   vstrip.clear();
00502   vadc.clear();
00503   
00504   for(edm::DetSet<SiStripDigi>::const_iterator digis_iter=digis_ds_.data.begin();
00505                                                digis_iter!=digis_ds_.data.end();digis_iter++){
00506     vstrip.push_back(digis_iter->strip());
00507     vadc.push_back(digis_iter->adc());
00508   }
00509   findNeigh("digi",clusters_ds_,vadc,vstrip);
00510 }  

void SiStripClusterInfo::findNeigh ( char *  mode,
edmNew::DetSet< SiStripCluster clusters_ds_,
std::vector< int16_t > &  vadc,
std::vector< int16_t > &  vstrip 
) [private]

Definition at line 514 of file SiStripClusterInfo.cc.

References amplitudeC_, amplitudesL_, amplitudesR_, edmNew::DetSet< T >::begin(), edmNew::DetSet< T >::end(), lat::endl(), find(), gainHandle_, getMaxPosition(), edmNew::DetSet< T >::id(), neighbourStripNr_, and ptr.

Referenced by digi_algorithm(), and rawdigi_algorithm().

00517                                                                               {
00518   
00519   // clean the private members
00520   //  before filling with the neighbours
00521   amplitudeC_ = 0;
00522   amplitudesL_.clear();
00523   amplitudesR_.clear();
00524   //
00525   
00526   // Find Digi adiacent to the clusters of this detid
00527   int16_t lastStrip_previousCluster=-1;
00528   int16_t firstStrip_nextCluster=10000;
00529   
00530   for (edmNew::DetSet<SiStripCluster>::const_iterator clusters_iter=clusters_ds_.begin(); 
00531        clusters_iter!=clusters_ds_.end(); clusters_iter++){     
00532     
00533     // Avoid overlapping with neighbour clusters
00534     if (clusters_iter!=clusters_ds_.begin())
00535       lastStrip_previousCluster=(clusters_iter-1)->firstStrip()+(clusters_iter-1)->amplitudes().size() -1;        
00536     if (clusters_iter!=clusters_ds_.end()-1)
00537       firstStrip_nextCluster=(clusters_iter+1)->firstStrip();
00538     
00539     
00540     // Get Gain Range
00541     SiStripApvGain::Range detGainRange = gainHandle_->getRange(clusters_ds_.id());
00542     
00543     // Left or Right with respect to the Central Strip (Cluster Seed)
00544     //    int16_t firstStrip=clusters_iter->firstStrip();
00545     //    int16_t lastStrip=firstStrip + clusters_iter->amplitudes().size() -1;
00546     int16_t firstStrip=getMaxPosition(clusters_iter);
00547     int16_t lastStrip=firstStrip;
00548     //    std::cout << "firstStrip = " << firstStrip << " lastStrip = " << lastStrip << std::endl;
00549     std::vector<int16_t>::iterator ptr;
00550     if (mode=="digi"){
00551       ptr=std::find(vstrip.begin(),vstrip.end(),firstStrip); 
00552       if (ptr==vstrip.end())
00553         throw cms::Exception("") << "\n Expected Digi not found in detid " << clusters_ds_.id() << " strip " << firstStrip << std::endl;
00554     }
00555     else{ 
00556       ptr=vstrip.begin()+firstStrip; // For raw mode vstrip==vadc==vector of digis for all strips in the det
00557     }
00558     
00559     // Central Digi from the ptr to the central strip
00560     int centralPos = ptr-vstrip.begin();
00561     if (mode=="digi")
00562       centralPos=*(vstrip.begin()+centralPos);
00563     //    std::cout << "centralPos = " << centralPos << std::endl;
00564     float gain=gainHandle_->getStripGain(centralPos,detGainRange);
00565     amplitudeC_ = ( (*(vadc.begin()+(ptr-vstrip.begin()))) / gain );
00566     
00567     // Looking at digis before firstStrip         
00568     for (uint16_t istrip=1;istrip<neighbourStripNr_+1;istrip++){
00569       if (istrip>ptr-vstrip.begin()) //avoid underflow
00570         {break;}
00571       if (mode=="digi")
00572         if (firstStrip-istrip!=*(ptr-istrip)) //avoid not contiguous digis
00573           {break;}
00574       if (firstStrip-istrip==lastStrip_previousCluster) //avoid clusters overlapping 
00575         {break;}
00576       int stripPos=ptr-vstrip.begin()-istrip;
00577       if (mode=="digi")
00578         stripPos=*(vstrip.begin()+stripPos);
00579       //      std::cout << "stripPos = " << stripPos << std::endl;
00580       float gain=gainHandle_->getStripGain(stripPos,detGainRange);
00581       amplitudesL_.push_back( (*(vadc.begin()+(ptr-vstrip.begin())-istrip)) / gain );
00582     }
00583     
00584     ptr+=lastStrip-firstStrip;
00585     
00586     // Looking at digis after LastStrip
00587     for (uint16_t istrip=1;istrip<neighbourStripNr_+1;istrip++){
00588       if (istrip>vstrip.end()-ptr-1) //avoid overflow
00589         {break;}
00590       if (mode=="digi")
00591         if (lastStrip+istrip!=*(ptr+istrip)) //avoid not contiguous digis
00592           {break;}
00593       if (lastStrip+istrip==firstStrip_nextCluster) //avoid clusters overlapping 
00594         {break;}
00595       int stripPos=ptr-vstrip.begin()+istrip;
00596       if (mode=="digi")
00597         stripPos=*(vstrip.begin()+stripPos);
00598       //      std::cout << "stripPos = " << stripPos << std::endl;
00599       float gain=gainHandle_->getStripGain(stripPos,detGainRange);
00600       amplitudesR_.push_back( (*(vadc.begin()+(ptr-vstrip.begin())+istrip)) / gain );
00601     }   
00602   }
00603 }

std::vector< float > SiStripClusterInfo::getApvGains (  )  const

Vector of APV Gain.

Definition at line 305 of file SiStripClusterInfo.cc.

References SiStripCluster::amplitudes(), cluster_, cluster_detId_, SiStripCluster::firstStrip(), sistrip::extrainfo::gain_, gainHandle_, and i.

Referenced by getGainForStripNb().

00305                                                        {
00306   
00307   std::vector<float>   apvGains_;
00308   SiStripApvGain::Range detGainRange = gainHandle_->getRange(cluster_detId_);   
00309   
00310   const std::vector<uint8_t>& amplitudes_ =  cluster_->amplitudes();
00311   
00312   for(size_t i=0; i<amplitudes_.size();i++){    
00313     float gain_=gainHandle_->getStripGain(cluster_->firstStrip()+i,detGainRange);
00314     if (apvGains_.empty())           apvGains_.push_back(gain_);
00315     else if (apvGains_.back()!=gain_) apvGains_.push_back(gain_);         
00316   } 
00317   
00318   return apvGains_;
00319   
00320 }

float SiStripClusterInfo::getCharge (  )  const

Cluster Charge (Signal).

Definition at line 74 of file SiStripClusterInfo.cc.

References SiStripCluster::amplitudes(), cluster_, and i.

Referenced by SiStripMonitorTrackEfficiency::clusterInfos(), cms::ClusterAnalysis::clusterInfos(), cms::ClusterAnalysisFilter::ClusterInModuleSelector(), SiStripMonitorTrack::fillCapacitiveCouplingMEs(), SiStripMonitorTrack::fillModMEs(), SiStripMonitorTrackEfficiency::fillModMEs(), SiStripMonitorTrackEfficiency::fillTrendMEs(), and SiStripMonitorTrack::fillTrendMEs().

00074                                           {
00075   
00076   float charge_=0;
00077   const std::vector<uint8_t>& amplitudes_ =  cluster_->amplitudes();
00078   
00079   for(size_t i=0; i< amplitudes_.size();i++){
00080     if (amplitudes_[i] > 0){  // redundant as always fullfilled for cluster amplitudes
00081       charge_+=amplitudes_[i];
00082     } 
00083   } 
00084   
00085   return charge_ ;
00086   
00087 }

std::pair< float, float > SiStripClusterInfo::getChargeLR (  )  const

Sum of the cluster strip charges Left/Right the Cluster Seed.

Definition at line 164 of file SiStripClusterInfo.cc.

References SiStripCluster::amplitudes(), cluster_, SiStripCluster::firstStrip(), getMaxPosition(), and i.

00164                                                            {
00165   
00166   float chargeL_=0;
00167   float chargeR_=0; 
00168   uint16_t maxPosition_ = this->getMaxPosition();
00169   const std::vector<uint8_t>& amplitudes_ =  cluster_->amplitudes();
00170   
00171   for(size_t i=0; i<amplitudes_.size();i++){
00172     if ((cluster_->firstStrip())+i < maxPosition_) chargeL_+=(float)amplitudes_[i];       
00173     if ((cluster_->firstStrip())+i > maxPosition_) chargeR_+=(float)amplitudes_[i];       
00174   }
00175   
00176   return std::pair<float,float>(chargeL_,chargeR_);
00177   
00178 }

std::pair< float, float > SiStripClusterInfo::getChargeLRFirstNeighbour (  )  const

Cluster Charge of the first strip Left/Right the Cluster Seed.

Definition at line 181 of file SiStripClusterInfo.cc.

References SiStripCluster::amplitudes(), cluster_, getFirstStrip(), and getMaxPosition().

Referenced by SiStripMonitorTrack::fillCapacitiveCouplingMEs().

00181                                                                          {
00182   
00183   uint16_t maxPosition = this->getMaxPosition();
00184   uint16_t firstStrip  = this->getFirstStrip();
00185   const std::vector<uint8_t>& amplitudes =  cluster_->amplitudes();
00186   
00187   float chargeL = ( maxPosition > firstStrip                           ? (float)amplitudes[maxPosition-firstStrip-1] : 0. );
00188   float chargeR = ( maxPosition < firstStrip + (amplitudes.size() - 1) ? (float)amplitudes[maxPosition-firstStrip+1] : 0. );
00189   
00190   //  std::cout << this->getDetId() << ": " << chargeL << " " << chargeR << " width " << amplitudes.size() << std::endl;
00191   
00192   return std::pair<float,float>(chargeL,chargeR);
00193   
00194 }

uint32_t SiStripClusterInfo::getDetId (  )  const [inline]

Cluster DetId.

Definition at line 63 of file SiStripClusterInfo.h.

References cluster_detId_.

Referenced by SiStripMonitorTrack::fillCapacitiveCouplingMEs().

00063 {return cluster_detId_;};

std::pair< std::vector< float >, std::vector< float > > SiStripClusterInfo::getDigiAmplitudesLR ( uint32_t &  neighbourStripNr,
const edm::DetSet< SiStripDigi > &  digis_ds_,
edmNew::DetSet< SiStripCluster > &  clusters_ds_ 
)

Vectors of the cluster strip charges Left/Right the Cluster Seed from Digis.

Definition at line 408 of file SiStripClusterInfo.cc.

References amplitudesL_, amplitudesR_, digi_algorithm(), and neighbourStripNr_.

00410                                                                                                                                               {
00411   neighbourStripNr_ = neighbourStripNr;
00412   
00413   digi_algorithm(digis_ds_,clusters_ds_);
00414   
00415   return std::pair< std::vector<float>,std::vector<float> > (amplitudesL_, amplitudesR_);
00416 }

std::pair< std::vector< float >, std::vector< float > > SiStripClusterInfo::getDigiAmplitudesLR ( uint32_t &  neighbourStripNr,
const edm::DetSetVector< SiStripDigi > &  digis_dsv_,
edmNew::DetSetVector< SiStripCluster > &  clusters_dsv_ 
)

Vectors of the cluster strip charges Left/Right the Cluster Seed from Digis.

Definition at line 386 of file SiStripClusterInfo.cc.

References amplitudesL_, amplitudesR_, cluster_detId_, digi_algorithm(), edm::DetSetVector< T >::end(), lat::endl(), Exception, edm::DetSetVector< T >::find(), and neighbourStripNr_.

00388                                                                                                                                                     {
00389   
00390   neighbourStripNr_ = neighbourStripNr;
00391   
00392   const edm::DetSet<SiStripDigi>    digis_ds_ =   digis_dsv_[cluster_detId_];
00393   edmNew::DetSet<SiStripCluster> clusters_ds_ = clusters_dsv_[cluster_detId_];
00394 
00395   if (digis_dsv_.find(cluster_detId_)!=digis_dsv_.end()){
00396   
00397     digi_algorithm(digis_ds_,clusters_ds_);          
00398     
00399     return std::pair< std::vector<float>,std::vector<float> > (amplitudesL_, amplitudesR_);
00400   }
00401   else {
00402     throw cms::Exception("CorruptedData")
00403       << "[SiStripClusterInfo::getDigiAmplitudesLR] reached already end " << std::endl;
00404   }
00405  
00406 }

uint16_t SiStripClusterInfo::getFirstStrip (  )  const [inline]

Cluster First Strip Number (the first strip is 0, this number can be used as index of a vector).

Definition at line 66 of file SiStripClusterInfo.h.

References cluster_, and SiStripCluster::firstStrip().

Referenced by cms::ClusterAnalysis::clusterInfos(), SiStripMonitorTrack::fillCapacitiveCouplingMEs(), SiStripMonitorTrack::fillModMEs(), SiStripMonitorTrackEfficiency::fillModMEs(), and getChargeLRFirstNeighbour().

00066 {return cluster_->firstStrip();}

float SiStripClusterInfo::getGainForStripNb ( uint16_t  istrip  )  const

Strip APV Gain.

Definition at line 323 of file SiStripClusterInfo.cc.

References cluster_, SiStripCluster::firstStrip(), getApvGains(), and int.

00323                                                                 {
00324   
00325   std::vector<float>   apvGains_;       
00326   apvGains_ = this->getApvGains();
00327   
00328   short apv_of_istrip = (int) ((cluster_->firstStrip()+istrip)/128);  
00329   short apv_of_firstStrip_ = (int) (cluster_->firstStrip()/128);  
00330   
00331   return apvGains_[apv_of_istrip-apv_of_firstStrip_];
00332   
00333 }

float SiStripClusterInfo::getMaxCharge (  )  const

Charge of the Strip with maximum charge in the cluster (Cluster Seed).

Definition at line 115 of file SiStripClusterInfo.cc.

References SiStripCluster::amplitudes(), cluster_, and i.

Referenced by SiStripMonitorTrack::fillCapacitiveCouplingMEs(), SiStripMonitorTrack::fillModMEs(), and SiStripMonitorTrackEfficiency::fillModMEs().

00115                                              {
00116   
00117   const std::vector<uint8_t>& amplitudes_ =  cluster_->amplitudes();  
00118   float maxCharge_=0;
00119   
00120   for(size_t i=0; i< amplitudes_.size();i++){
00121     if (amplitudes_[i] > 0){
00122       if (maxCharge_<amplitudes_[i]){ 
00123         maxCharge_=amplitudes_[i];
00124       }
00125     } 
00126   } 
00127   return maxCharge_;
00128 }

uint16_t SiStripClusterInfo::getMaxPosition ( const SiStripCluster cluster  )  const

Strip Number of the strip with maximum charge in the cluster (Cluster Seed) (the first strip is 0, this number can be used as index of a vector).

Definition at line 94 of file SiStripClusterInfo.cc.

References SiStripCluster::amplitudes(), SiStripCluster::firstStrip(), and i.

00094                                                                                {
00095   
00096   uint16_t maxPosition_=0;
00097   const std::vector<uint8_t>& amplitudes_ =  cluster->amplitudes();  
00098   float maxCharge_=0;
00099   
00100   for(size_t i=0; i< amplitudes_.size();i++){
00101     if (amplitudes_[i] > 0){ // redundant as always fullfilled for cluster amplitudes
00102       if (maxCharge_<amplitudes_[i]){ 
00103         maxCharge_=amplitudes_[i];
00104         maxPosition_=i;
00105       }
00106     } 
00107   } 
00108   maxPosition_+=cluster->firstStrip();
00109   
00110   return maxPosition_;
00111   
00112 }

uint16_t SiStripClusterInfo::getMaxPosition (  )  const

Strip Number of the strip with maximum charge in the cluster (Cluster Seed) (the first strip is 0, this number can be used as index of a vector).

Definition at line 90 of file SiStripClusterInfo.cc.

References cluster_.

Referenced by SiStripMonitorTrack::fillCapacitiveCouplingMEs(), SiStripMonitorTrack::fillModMEs(), SiStripMonitorTrackEfficiency::fillModMEs(), findNeigh(), getChargeLR(), and getChargeLRFirstNeighbour().

00090                                                   {
00091   return getMaxPosition(cluster_);
00092 }

float SiStripClusterInfo::getNoise (  ) 

Cluster Noise.

Definition at line 237 of file SiStripClusterInfo.cc.

References SiStripCluster::amplitudes(), cluster_, cluster_detId_, SiStripCluster::firstStrip(), i, sistrip::extrainfo::noise_, noiseHandle_, and funct::sqrt().

Referenced by SiStripMonitorTrackEfficiency::clusterInfos(), cms::ClusterAnalysis::clusterInfos(), cms::ClusterAnalysisFilter::ClusterInModuleSelector(), SiStripMonitorTrackEfficiency::fillModMEs(), and SiStripMonitorTrackEfficiency::fillTrendMEs().

00237                                    {
00238     
00239   int numberOfPosAmplitudes_=0;
00240   float        clusterNoise_=0;  
00241   float       clusterNoise2_=0;
00242   
00243   SiStripNoises::Range detNoiseRange = noiseHandle_->getRange(cluster_detId_);
00244   
00245   const std::vector<uint8_t>& amplitudes_ =  cluster_->amplitudes();
00246   
00247   for(size_t i=0; i<amplitudes_.size();i++){
00248     
00249     float noise_=noiseHandle_->getNoise(cluster_->firstStrip()+i,detNoiseRange);
00250     
00251     if (amplitudes_[i]>0){
00252       clusterNoise2_+=noise_*noise_;
00253       numberOfPosAmplitudes_++;  
00254     } 
00255   }   
00256   clusterNoise_= sqrt(clusterNoise2_/numberOfPosAmplitudes_);
00257   
00258   return clusterNoise_;
00259   
00260 }

float SiStripClusterInfo::getNoiseForStripNb ( uint16_t  istrip  )  const

Strip Noise.

Definition at line 292 of file SiStripClusterInfo.cc.

References cluster_, SiStripCluster::firstStrip(), getStripNoises(), and int.

00292                                                                  {
00293   
00294   std::vector<float>   stripNoises_;    
00295   stripNoises_ = this->getStripNoises();
00296   
00297   short strip_of_istrip     = (int) ((cluster_->firstStrip()+istrip)/128);  
00298   short strip_of_firstStrip_ = (int) (cluster_->firstStrip()/128);  
00299   
00300   return stripNoises_[strip_of_istrip-strip_of_firstStrip_];
00301   
00302 }

float SiStripClusterInfo::getNoiseRescaledByGain (  ) 

Cluster Noise rescaled by APV Gain.

Definition at line 263 of file SiStripClusterInfo.cc.

References SiStripCluster::amplitudes(), cluster_, cluster_detId_, SiStripCluster::firstStrip(), sistrip::extrainfo::gain_, gainHandle_, i, sistrip::extrainfo::noise_, noiseHandle_, and funct::sqrt().

Referenced by SiStripMonitorTrack::fillCapacitiveCouplingMEs(), and SiStripMonitorTrack::fillTrendMEs().

00263                                                  {
00264     
00265   int numberOfPosAmplitudes_=0;
00266   float       clusterNoise_ =0;  
00267   float       clusterNoise2_=0;  
00268   
00269   SiStripNoises::Range detNoiseRange = noiseHandle_->getRange(cluster_detId_);
00270   SiStripApvGain::Range detGainRange = gainHandle_->getRange(cluster_detId_);   
00271   
00272   const std::vector<uint8_t>& amplitudes_ =  cluster_->amplitudes();
00273   
00274   for(size_t i=0; i<amplitudes_.size();i++){
00275     
00276     float gain_=gainHandle_->getStripGain(cluster_->firstStrip()+i,detGainRange);
00277     float noise_=noiseHandle_->getNoise(cluster_->firstStrip()+i,detNoiseRange);
00278     noise_=noise_/gain_;
00279     
00280     if (amplitudes_[i]>0){
00281       clusterNoise2_+=noise_*noise_;
00282       numberOfPosAmplitudes_++;  
00283     } 
00284   }   
00285   clusterNoise_= sqrt(clusterNoise2_/numberOfPosAmplitudes_);
00286   
00287   return clusterNoise_;
00288   
00289 }

float SiStripClusterInfo::getPosition (  )  const [inline]

Cluster Position.

Definition at line 68 of file SiStripClusterInfo.h.

References SiStripCluster::barycenter(), and cluster_.

Referenced by cms::ClusterAnalysis::clusterInfos(), SiStripMonitorTrack::fillModMEs(), SiStripMonitorTrackEfficiency::fillModMEs(), SiStripMonitorTrackEfficiency::fillTrendMEs(), and SiStripMonitorTrack::fillTrendMEs().

00068 {return cluster_->barycenter();}

std::vector< float > SiStripClusterInfo::getRawChargeCLR ( const edm::DetSet< SiStripRawDigi > &  ds_SiStripRawDigi,
edmNew::DetSet< SiStripCluster > &  ds_SiStripCluster,
std::string  rawDigiLabel 
)

RawDigi Charge (Cluster Seed,First Left Strip,First Right Strip).

Definition at line 131 of file SiStripClusterInfo.cc.

References amplitudeC_, cluster_detId_, getRawDigiAmplitudesLR(), edm::isDebugEnabled(), and LogDebug.

Referenced by SiStripMonitorTrack::fillCapacitiveCouplingMEs().

00133                                                                                                            {
00134   std::vector<float> adcCLR(3*0);
00135   
00136   // Get First Left and First Right
00137   uint32_t neighbourStrips = 1;
00138   std::pair< std::vector<float>,std::vector<float> > rawChargesLR =
00139     this->getRawDigiAmplitudesLR(neighbourStrips, ds_SiStripRawDigi, ds_SiStripCluster, std::string(rawDigiLabel));
00140   
00141   if (edm::isDebugEnabled()){
00142     std::stringstream sssL;
00143     std::stringstream sssR;
00144     // Left
00145     for(std::vector<float>::const_iterator digi_adc_iter=rawChargesLR.first.begin();
00146         digi_adc_iter!=rawChargesLR.first.end();digi_adc_iter++)
00147       sssL << "\n digi adc " << *digi_adc_iter;
00148     LogDebug("SiStripClusterInfo") << " detid " << cluster_detId_  << "\n Max Left RawDigis \n " << sssL.str();
00149     // Right
00150     for(std::vector<float>::const_iterator digi_adc_iter=rawChargesLR.second.begin();
00151         digi_adc_iter!=rawChargesLR.second.end();digi_adc_iter++)
00152       sssR << "\n digi adc " << *digi_adc_iter;
00153     LogDebug("SiStripClusterInfo") << " detid " << cluster_detId_  << "\n Max Right RawDigis \n " << sssR.str();
00154   }
00155   
00156   adcCLR[0] = amplitudeC_;
00157   adcCLR[1] = rawChargesLR.first[0];
00158   adcCLR[2] = rawChargesLR.second[0];
00159   
00160   return adcCLR;
00161 }

std::pair< std::vector< float >, std::vector< float > > SiStripClusterInfo::getRawDigiAmplitudesLR ( uint32_t &  neighbourStripNr,
const edm::DetSet< SiStripRawDigi > &  rawDigis_ds_,
edmNew::DetSet< SiStripCluster > &  clusters_ds_,
std::string  rawDigiLabel 
)

Vectors of the cluster strip charges Left/Right the Cluster Seed from RawDigis.

Definition at line 372 of file SiStripClusterInfo.cc.

References amplitudesL_, amplitudesR_, neighbourStripNr_, and rawdigi_algorithm().

00375                                                                                                                                                  {
00376   neighbourStripNr_ = neighbourStripNr;
00377   
00378   //QUESTION: here no test?
00379   rawdigi_algorithm(rawDigis_ds_,clusters_ds_,rawDigiLabel);
00380   
00381   return std::pair< std::vector<float>,std::vector<float> > (amplitudesL_, amplitudesR_);
00382 }

std::pair< std::vector< float >, std::vector< float > > SiStripClusterInfo::getRawDigiAmplitudesLR ( uint32_t &  neighbourStripNr,
const edm::DetSetVector< SiStripRawDigi > &  rawDigis_dsv_,
edmNew::DetSetVector< SiStripCluster > &  clusters_dsv_,
std::string  rawDigiLabel 
)

Vectors of the cluster strip charges Left/Right the Cluster Seed from RawDigis.

Definition at line 350 of file SiStripClusterInfo.cc.

References amplitudesL_, amplitudesR_, cluster_detId_, edm::DetSetVector< T >::end(), lat::endl(), Exception, edm::DetSetVector< T >::find(), neighbourStripNr_, and rawdigi_algorithm().

Referenced by getRawChargeCLR().

00353                                                                                                                                                         {
00354   neighbourStripNr_ = neighbourStripNr;
00355   
00356   const edm::DetSet<SiStripRawDigi> rawDigis_ds_ = rawDigis_dsv_[cluster_detId_];
00357   edmNew::DetSet<SiStripCluster>    clusters_ds_ = clusters_dsv_[cluster_detId_];
00358  
00359   if (rawDigis_dsv_.find(cluster_detId_)!=rawDigis_dsv_.end()){
00360   
00361     rawdigi_algorithm(rawDigis_ds_,clusters_ds_,rawDigiLabel);
00362   
00363     return std::pair< std::vector<float>,std::vector<float> > (amplitudesL_, amplitudesR_);
00364   }    
00365   else {
00366     throw cms::Exception("CorruptedData")
00367       << "[SiStripClusterInfo::getRawDigiAmplitudesLR] reached already end " << std::endl;
00368   }
00369 }

float SiStripClusterInfo::getSignalOverNoise (  ) 

Cluster Signal-to-Noise ratio (S/N).

Definition at line 336 of file SiStripClusterInfo.cc.

00336                                              {
00337   
00338   return (this->getCharge())/(this->getNoise());
00339   
00340 }

float SiStripClusterInfo::getSignalOverNoiseRescaledByGain (  ) 

Cluster Signal-to-Noise ratio (S/N) rescaled by APV Gain.

Definition at line 343 of file SiStripClusterInfo.cc.

Referenced by SiStripMonitorTrack::clusterInfos(), SiStripMonitorTrack::fillCapacitiveCouplingMEs(), SiStripMonitorTrack::fillModMEs(), and SiStripMonitorTrack::fillTrendMEs().

00343                                                            {
00344   
00345   return (this->getCharge())/(this->getNoiseRescaledByGain());
00346   
00347 }

const std::vector<uint8_t>& SiStripClusterInfo::getStripAmplitudes (  )  const [inline]

Vector of Cluster Strip Charge.

Definition at line 70 of file SiStripClusterInfo.h.

References SiStripCluster::amplitudes(), and cluster_.

Referenced by SiStripMonitorTrack::fillCapacitiveCouplingMEs(), SiStripMonitorTrack::fillModMEs(), and SiStripMonitorTrackEfficiency::fillModMEs().

00070 {return cluster_->amplitudes();} 

std::vector< float > SiStripClusterInfo::getStripNoises (  )  const

Vector of Cluster Strip Noise.

Definition at line 197 of file SiStripClusterInfo.cc.

References SiStripCluster::amplitudes(), cluster_, cluster_detId_, SiStripCluster::firstStrip(), i, sistrip::extrainfo::noise_, and noiseHandle_.

Referenced by getNoiseForStripNb().

00197                                                           {
00198   
00199   std::vector<float>   stripNoises_;
00200   SiStripNoises::Range detNoiseRange = noiseHandle_->getRange(cluster_detId_);  
00201   const std::vector<uint8_t>& amplitudes_ =  cluster_->amplitudes();
00202   
00203   for(size_t i=0; i<amplitudes_.size();i++){
00204     
00205     float noise_=noiseHandle_->getNoise(cluster_->firstStrip()+i,detNoiseRange);        
00206     stripNoises_.push_back(noise_);
00207     
00208   } 
00209   
00210   return stripNoises_;
00211   
00212 }

std::vector< float > SiStripClusterInfo::getStripNoisesRescaledByGain (  )  const

Vector of Cluster Strip Noise rescaled by APV Gain.

Definition at line 215 of file SiStripClusterInfo.cc.

References SiStripCluster::amplitudes(), cluster_, cluster_detId_, SiStripCluster::firstStrip(), sistrip::extrainfo::gain_, gainHandle_, i, sistrip::extrainfo::noise_, and noiseHandle_.

00215                                                                         {
00216   
00217   std::vector<float>   stripNoises_;
00218   SiStripNoises::Range detNoiseRange = noiseHandle_->getRange(cluster_detId_);  
00219   SiStripApvGain::Range detGainRange = gainHandle_->getRange(cluster_detId_);   
00220   const std::vector<uint8_t>& amplitudes_ =  cluster_->amplitudes();
00221   
00222   for(size_t i=0; i<amplitudes_.size();i++){
00223     
00224     float gain_=gainHandle_->getStripGain(cluster_->firstStrip()+i,detGainRange);
00225     float noise_=noiseHandle_->getNoise(cluster_->firstStrip()+i,detNoiseRange);
00226     noise_=noise_/gain_;
00227     
00228     stripNoises_.push_back(noise_);
00229     
00230   } 
00231   
00232   return stripNoises_;
00233   
00234 }

float SiStripClusterInfo::getWidth (  )  const [inline]

Cluster Width.

Definition at line 74 of file SiStripClusterInfo.h.

References SiStripCluster::amplitudes(), and cluster_.

Referenced by SiStripMonitorTrackEfficiency::clusterInfos(), SiStripMonitorTrack::clusterInfos(), cms::ClusterAnalysis::clusterInfos(), cms::ClusterAnalysisFilter::ClusterInModuleSelector(), SiStripMonitorTrack::fillCapacitiveCouplingMEs(), SiStripMonitorTrack::fillModMEs(), SiStripMonitorTrackEfficiency::fillModMEs(), SiStripMonitorTrackEfficiency::fillTrendMEs(), and SiStripMonitorTrack::fillTrendMEs().

00074 {return cluster_->amplitudes().size();}

void SiStripClusterInfo::rawdigi_algorithm ( const edm::DetSet< SiStripRawDigi rawDigis_ds_,
edmNew::DetSet< SiStripCluster clusters_ds_,
std::string  rawDigiLabel 
) [private]

Definition at line 419 of file SiStripClusterInfo.cc.

References cluster_detId_, edm::DetSet< T >::data, lat::endl(), es_, Exception, findNeigh(), edm::DetSet< T >::id, SiStripCommonModeNoiseSubtractor::init(), SiStripPedestalsSubtractor::init(), edm::isDebugEnabled(), LogDebug, SiStripCommonModeNoiseSubtractor_, SiStripPedestalsSubtractor_, edm::DetSet< T >::size(), SiStripCommonModeNoiseSubtractor::subtract(), SiStripPedestalsSubtractor::subtract(), and validCMNSubtraction_.

Referenced by getRawDigiAmplitudesLR().

00421                                                                                              {
00422   
00423   std::vector<int16_t> vssRd(rawDigis_ds_.size());
00424   
00425   if ( rawDigiLabel == "ProcessedRaw"){
00426     
00427     for(edm::DetSet<SiStripRawDigi>::const_iterator digis_iter=rawDigis_ds_.data.begin();
00428                                                    digis_iter!=rawDigis_ds_.data.end();digis_iter++){
00429       vssRd.push_back(digis_iter->adc());
00430       
00431       if (edm::isDebugEnabled()){
00432         std::stringstream sss;
00433         int idig=0;
00434         
00435         for(std::vector<int16_t>::const_iterator digi_adc_iter=vssRd.begin();
00436                                                 digi_adc_iter!=vssRd.end();digi_adc_iter++)
00437           sss << "\n digi strip " << idig++ << " digi adc " << *digi_adc_iter;
00438         LogDebug("SiStripClusterInfo") << " detid " << cluster_detId_  << " Pedestal subtracted digis \n" << sss.str(); 
00439       }     
00440     }
00441   } else if ( rawDigiLabel == "VirginRaw" ) {
00442     
00443     if (edm::isDebugEnabled()){
00444       std::stringstream sss;
00445       int idig=0;
00446       
00447       for(edm::DetSet<SiStripRawDigi>::const_iterator digis_iter=rawDigis_ds_.data.begin();
00448                                                      digis_iter!=rawDigis_ds_.data.end();digis_iter++)
00449         sss << "\n digi strip " << idig++ << " digi adc " << digis_iter->adc();
00450       LogDebug("SiStripClusterInfo") << " detid " << cluster_detId_  << "\n RawDigis \n" << sss.str();
00451     }
00452     
00453     //Subtract Pedestals
00454     SiStripPedestalsSubtractor_->init(es_);
00455     SiStripPedestalsSubtractor_->subtract(rawDigis_ds_,vssRd);
00456     
00457     if (edm::isDebugEnabled()){
00458       std::stringstream sss;
00459       int idig=0;
00460       
00461       for(std::vector<int16_t>::const_iterator digi_adc_iter=vssRd.begin();
00462                                               digi_adc_iter!=vssRd.end();digi_adc_iter++)
00463         sss << "\n digi strip " << idig++ << " digi adc " << *digi_adc_iter;
00464       LogDebug("SiStripClusterInfo") << " detid " << cluster_detId_  << "\n Pedestal subtracted digis \n " << sss.str();        
00465     }
00466     
00467     //Subtract CMN
00468     if (validCMNSubtraction_){
00469       SiStripCommonModeNoiseSubtractor_->init(es_);
00470       SiStripCommonModeNoiseSubtractor_->subtract(rawDigis_ds_.id,vssRd);
00471       
00472       if (edm::isDebugEnabled()){
00473         std::stringstream sss;
00474         int idig=0;
00475         
00476         for(std::vector<int16_t>::const_iterator digi_adc_iter=vssRd.begin();
00477                                                 digi_adc_iter!=vssRd.end();digi_adc_iter++)
00478           sss << "\n digi strip " << idig++ << " digi adc " << *digi_adc_iter;
00479         LogDebug("SiStripClusterInfo") << " detid " << cluster_detId_  << "\n CMN subtracted digis \n " << sss.str();   
00480       }
00481       
00482     }else{
00483       throw cms::Exception("") 
00484         << "[" << __PRETTY_FUNCTION__<< "] No valid CommonModeNoiseSubtraction Mode selected, possible CMNSubtractionMode: Median or TT6"
00485         << std::endl;
00486     }
00487   } else {
00488     return;
00489   }  
00490   findNeigh("raw",clusters_ds_,vssRd,vssRd);    
00491 }


Member Data Documentation

float SiStripClusterInfo::amplitudeC_ [private]

Definition at line 171 of file SiStripClusterInfo.h.

Referenced by findNeigh(), and getRawChargeCLR().

std::vector<float> SiStripClusterInfo::amplitudesL_ [private]

Definition at line 172 of file SiStripClusterInfo.h.

Referenced by findNeigh(), getDigiAmplitudesLR(), and getRawDigiAmplitudesLR().

std::vector<float> SiStripClusterInfo::amplitudesR_ [private]

Definition at line 173 of file SiStripClusterInfo.h.

Referenced by findNeigh(), getDigiAmplitudesLR(), and getRawDigiAmplitudesLR().

const SiStripCluster* SiStripClusterInfo::cluster_ [private]

Definition at line 163 of file SiStripClusterInfo.h.

Referenced by getApvGains(), getCharge(), getChargeLR(), getChargeLRFirstNeighbour(), getFirstStrip(), getGainForStripNb(), getMaxCharge(), getMaxPosition(), getNoise(), getNoiseForStripNb(), getNoiseRescaledByGain(), getPosition(), getStripAmplitudes(), getStripNoises(), getStripNoisesRescaledByGain(), getWidth(), and SiStripClusterInfo().

uint32_t SiStripClusterInfo::cluster_detId_ [private]

Definition at line 164 of file SiStripClusterInfo.h.

Referenced by getApvGains(), getDetId(), getDigiAmplitudesLR(), getNoise(), getNoiseRescaledByGain(), getRawChargeCLR(), getRawDigiAmplitudesLR(), getStripNoises(), getStripNoisesRescaledByGain(), rawdigi_algorithm(), and SiStripClusterInfo().

std::string SiStripClusterInfo::CMNSubtractionMode_ [private]

Definition at line 168 of file SiStripClusterInfo.h.

const edm::EventSetup& SiStripClusterInfo::es_ [private]

Definition at line 158 of file SiStripClusterInfo.h.

Referenced by rawdigi_algorithm().

edm::ESHandle<SiStripGain> SiStripClusterInfo::gainHandle_ [private]

Definition at line 160 of file SiStripClusterInfo.h.

Referenced by findNeigh(), getApvGains(), getNoiseRescaledByGain(), getStripNoisesRescaledByGain(), and SiStripClusterInfo().

uint32_t SiStripClusterInfo::neighbourStripNr_ [private]

Definition at line 166 of file SiStripClusterInfo.h.

Referenced by findNeigh(), getDigiAmplitudesLR(), and getRawDigiAmplitudesLR().

edm::ESHandle<SiStripNoises> SiStripClusterInfo::noiseHandle_ [private]

Definition at line 159 of file SiStripClusterInfo.h.

Referenced by getNoise(), getNoiseRescaledByGain(), getStripNoises(), getStripNoisesRescaledByGain(), and SiStripClusterInfo().

edm::ESHandle<SiStripPedestals> SiStripClusterInfo::pedestalsHandle_ [private]

Definition at line 161 of file SiStripClusterInfo.h.

Referenced by SiStripClusterInfo().

SiStripCommonModeNoiseSubtractor* SiStripClusterInfo::SiStripCommonModeNoiseSubtractor_ [private]

Definition at line 167 of file SiStripClusterInfo.h.

Referenced by rawdigi_algorithm(), SiStripClusterInfo(), and ~SiStripClusterInfo().

SiStripPedestalsSubtractor* SiStripClusterInfo::SiStripPedestalsSubtractor_ [private]

Definition at line 170 of file SiStripClusterInfo.h.

Referenced by rawdigi_algorithm(), SiStripClusterInfo(), and ~SiStripClusterInfo().

bool SiStripClusterInfo::validCMNSubtraction_ [private]

Definition at line 169 of file SiStripClusterInfo.h.

Referenced by rawdigi_algorithm(), and SiStripClusterInfo().


The documentation for this class was generated from the following files:
Generated on Tue Jun 9 18:32:14 2009 for CMSSW by  doxygen 1.5.4