CMS 3D CMS Logo

Classes | Public Types | Public Member Functions | Private Types | Private Attributes

SiStripDigitizerAlgorithm Class Reference

#include <SiStripDigitizerAlgorithm.h>

List of all members.

Classes

struct  AssociationInfo

Public Types

typedef float Amplitude
typedef
SiDigitalConverter::DigitalRawVecType 
DigitalRawVecType
typedef
SiDigitalConverter::DigitalVecType 
DigitalVecType
typedef std::map< int, float,
std::less< int > > 
hit_map_type
typedef
SiPileUpSignals::SignalMapType 
SignalMapType

Public Member Functions

void accumulateSimHits (const std::vector< PSimHit >::const_iterator inputBegin, const std::vector< PSimHit >::const_iterator inputEnd, size_t inputBeginGlobalIndex, const StripGeomDetUnit *stripdet, const GlobalVector &bfield, const TrackerTopology *tTopo)
void digitize (edm::DetSet< SiStripDigi > &outDigis, edm::DetSet< SiStripRawDigi > &outRawDigis, edm::DetSet< StripDigiSimLink > &outLink, const StripGeomDetUnit *stripdet, edm::ESHandle< SiStripGain > &, edm::ESHandle< SiStripThreshold > &, edm::ESHandle< SiStripNoises > &, edm::ESHandle< SiStripPedestals > &)
void initializeDetUnit (StripGeomDetUnit *det, const edm::EventSetup &iSetup)
void initializeEvent (const edm::EventSetup &iSetup)
void setParticleDataTable (const ParticleDataTable *pardt)
 SiStripDigitizerAlgorithm (const edm::ParameterSet &conf, CLHEP::HepRandomEngine &)
 ~SiStripDigitizerAlgorithm ()

Private Types

typedef std::map< int,
std::vector< AssociationInfo > > 
AssociationInfoForChannel
typedef std::map< uint32_t,
AssociationInfoForChannel
AssociationInfoForDetId

Private Attributes

std::map< unsigned int,
std::vector< bool > > 
allBadChannels
const bool APVSaturationFromHIP
const double APVSaturationProb
AssociationInfoForDetId associationInfoForDetId_
 Structure that holds the information on the SimTrack contributions. Only filled if makeDigiSimLinks_ is true.
const bool BaselineShift
const double cmnRMStec
const double cmnRMStib
const double cmnRMStid
const double cmnRMStob
const bool CommonModeNoise
const double cosmicShift
std::map< unsigned int, size_t > firstChannelsWithSignal
const double inefficiency
std::map< unsigned int, size_t > lastChannelsWithSignal
edm::ESHandle
< SiStripLorentzAngle
lorentzAngleHandle
const std::string lorentzAngleName
const bool makeDigiSimLinks_
const bool noise
const ParticleDataparticle
const ParticleDataTablepdt
const bool peakMode
const double pedOffset
const bool RealPedestals
const bool SingleStripNoise
const double theElectronPerADC
const int theFedAlgo
const std::unique_ptr
< CLHEP::RandFlat > 
theFlatDistribution
const std::unique_ptr
< SiTrivialDigitalConverter
theSiDigitalConverter
const std::unique_ptr
< SiHitDigitizer
theSiHitDigitizer
const std::unique_ptr< const
SiGaussianTailNoiseAdder
theSiNoiseAdder
const std::unique_ptr
< SiPileUpSignals
theSiPileUpSignals
const std::unique_ptr
< SiStripFedZeroSuppression
theSiZeroSuppress
const double theThreshold
const double theTOFCutForDeconvolution
const double theTOFCutForPeak
const double tofCut
const bool zeroSuppression

Detailed Description

SiStripDigitizerAlgorithm converts hits to digis

Definition at line 49 of file SiStripDigitizerAlgorithm.h.


Member Typedef Documentation

Definition at line 55 of file SiStripDigitizerAlgorithm.h.

typedef std::map<int, std::vector<AssociationInfo> > SiStripDigitizerAlgorithm::AssociationInfoForChannel [private]

Definition at line 148 of file SiStripDigitizerAlgorithm.h.

Definition at line 149 of file SiStripDigitizerAlgorithm.h.

Definition at line 52 of file SiStripDigitizerAlgorithm.h.

Definition at line 51 of file SiStripDigitizerAlgorithm.h.

typedef std::map< int, float, std::less<int> > SiStripDigitizerAlgorithm::hit_map_type

Definition at line 54 of file SiStripDigitizerAlgorithm.h.

Definition at line 53 of file SiStripDigitizerAlgorithm.h.


Constructor & Destructor Documentation

SiStripDigitizerAlgorithm::SiStripDigitizerAlgorithm ( const edm::ParameterSet conf,
CLHEP::HepRandomEngine &  eng 
)

Definition at line 29 of file SiStripDigitizerAlgorithm.cc.

References LogDebug, and peakMode.

                                                                                                          :
  lorentzAngleName(conf.getParameter<std::string>("LorentzAngle")),
  theThreshold(conf.getParameter<double>("NoiseSigmaThreshold")),
  cmnRMStib(conf.getParameter<double>("cmnRMStib")),
  cmnRMStob(conf.getParameter<double>("cmnRMStob")),
  cmnRMStid(conf.getParameter<double>("cmnRMStid")),
  cmnRMStec(conf.getParameter<double>("cmnRMStec")),
  APVSaturationProb(conf.getParameter<double>("APVSaturationProb")),
  makeDigiSimLinks_(conf.getUntrackedParameter<bool>("makeDigiSimLinks", false)),
  peakMode(conf.getParameter<bool>("APVpeakmode")),
  noise(conf.getParameter<bool>("Noise")),
  RealPedestals(conf.getParameter<bool>("RealPedestals")), 
  SingleStripNoise(conf.getParameter<bool>("SingleStripNoise")),
  CommonModeNoise(conf.getParameter<bool>("CommonModeNoise")),
  BaselineShift(conf.getParameter<bool>("BaselineShift")),
  APVSaturationFromHIP(conf.getParameter<bool>("APVSaturationFromHIP")),
  theFedAlgo(conf.getParameter<int>("FedAlgorithm")),
  zeroSuppression(conf.getParameter<bool>("ZeroSuppression")),
  theElectronPerADC(conf.getParameter<double>( peakMode ? "electronPerAdcPeak" : "electronPerAdcDec" )),
  theTOFCutForPeak(conf.getParameter<double>("TOFCutForPeak")),
  theTOFCutForDeconvolution(conf.getParameter<double>("TOFCutForDeconvolution")),
  tofCut(peakMode ? theTOFCutForPeak : theTOFCutForDeconvolution),
  cosmicShift(conf.getUntrackedParameter<double>("CosmicDelayShift")),
  inefficiency(conf.getParameter<double>("Inefficiency")),
  pedOffset((unsigned int)conf.getParameter<double>("PedestalsOffset")),
  theSiHitDigitizer(new SiHitDigitizer(conf, eng)),
  theSiPileUpSignals(new SiPileUpSignals()),
  theSiNoiseAdder(new SiGaussianTailNoiseAdder(theThreshold, eng)),
  theSiDigitalConverter(new SiTrivialDigitalConverter(theElectronPerADC)),
  theSiZeroSuppress(new SiStripFedZeroSuppression(theFedAlgo)),
  theFlatDistribution(new CLHEP::RandFlat(eng, 0., 1.)) {

  if (peakMode) {
    LogDebug("StripDigiInfo")<<"APVs running in peak mode (poor time resolution)";
  } else {
    LogDebug("StripDigiInfo")<<"APVs running in deconvolution mode (good time resolution)";
  };
}
SiStripDigitizerAlgorithm::~SiStripDigitizerAlgorithm ( )

Definition at line 68 of file SiStripDigitizerAlgorithm.cc.

                                                     {
}

Member Function Documentation

void SiStripDigitizerAlgorithm::accumulateSimHits ( const std::vector< PSimHit >::const_iterator  inputBegin,
const std::vector< PSimHit >::const_iterator  inputEnd,
size_t  inputBeginGlobalIndex,
const StripGeomDetUnit stripdet,
const GlobalVector bfield,
const TrackerTopology tTopo 
)

Definition at line 109 of file SiStripDigitizerAlgorithm.cc.

References allBadChannels, APVSaturationFromHIP, APVSaturationProb, associationInfoForDetId_, DeDxDiscriminatorTools::charge(), cosmicShift, gather_cfg::cout, firstChannelsWithSignal, GeomDet::geographicalId(), inefficiency, edm::ESHandleBase::isValid(), lastChannelsWithSignal, lorentzAngleHandle, mag(), makeDigiSimLinks_, NULL, particle, pdt, DetId::rawId(), StripGeomDetUnit::specificTopology(), GeomDet::surface(), theFlatDistribution, theSiHitDigitizer, theSiPileUpSignals, tofCut, Surface::toGlobal(), and zeroSuppression.

                                                                           {
  // produce SignalPoints for all SimHits in detector
  unsigned int detID = det->geographicalId().rawId();
  int numStrips = (det->specificTopology()).nstrips();  

  std::vector<bool>& badChannels = allBadChannels[detID];
  size_t thisFirstChannelWithSignal = numStrips;
  size_t thisLastChannelWithSignal = numStrips;

  float langle = (lorentzAngleHandle.isValid()) ? lorentzAngleHandle->getLorentzAngle(detID) : 0.;

  std::vector<float> locAmpl(numStrips, 0.);

  // Loop over hits

  uint32_t detId = det->geographicalId().rawId();
  // First: loop on the SimHits
  if(theFlatDistribution->fire()>inefficiency) {
    AssociationInfoForChannel* pDetIDAssociationInfo; // I only need this if makeDigiSimLinks_ is true...
    if( makeDigiSimLinks_ ) pDetIDAssociationInfo=&(associationInfoForDetId_[detId]); // ...so only search the map if that is the case
    std::vector<float> previousLocalAmplitude; // Only used if makeDigiSimLinks_ is true. Needed to work out the change in amplitude.

    size_t simHitGlobalIndex=inputBeginGlobalIndex; // This needs to stored to create the digi-sim link later
    for (std::vector<PSimHit>::const_iterator simHitIter = inputBegin; simHitIter != inputEnd; ++simHitIter, ++simHitGlobalIndex ) {
      // skip hits not in this detector.
      if((*simHitIter).detUnitId() != detId) {
        continue;
      }
      // check TOF
      if (std::fabs(simHitIter->tof() - cosmicShift - det->surface().toGlobal(simHitIter->localPosition()).mag()/30.) < tofCut && simHitIter->energyLoss()>0) {
        if( makeDigiSimLinks_ ) previousLocalAmplitude=locAmpl; // Not needed except to make the sim link association.
        size_t localFirstChannel = numStrips;
        size_t localLastChannel  = 0;
        // process the hit
        theSiHitDigitizer->processHit(&*simHitIter, *det, bfield, langle, locAmpl, localFirstChannel, localLastChannel, tTopo);
          
                  //APV Killer to simulate HIP effect
                  //------------------------------------------------------
                  
                  if(APVSaturationFromHIP&&!zeroSuppression){
                    int pdg_id = simHitIter->particleType();
                        particle = pdt->particle(pdg_id);
                        if(particle != NULL){
                                float charge = particle->charge();
                                bool isHadron = particle->isHadron();
                            if(charge!=0 && isHadron){
                                        if(theFlatDistribution->fire()<APVSaturationProb){
                                                int FirstAPV = localFirstChannel/128;
                                                int LastAPV = localLastChannel/128;
                                                std::cout << "-------------------HIP--------------" << std::endl;
                                                std::cout << "Killing APVs " << FirstAPV << " - " <<LastAPV << " " << detID <<std::endl;
                                                for(int strip = FirstAPV*128; strip < LastAPV*128 +128; ++strip) {
                                                        badChannels[strip] = true;
                                                }
                                                //doing like that I remove the signal information only after the 
                                                //stip that got the HIP but it remains the signal of the previous
                                                //one. I'll make a further loop to remove all signal
                                        }
                                }
                        }
              }             
                
    
        if(thisFirstChannelWithSignal > localFirstChannel) thisFirstChannelWithSignal = localFirstChannel;
        if(thisLastChannelWithSignal < localLastChannel) thisLastChannelWithSignal = localLastChannel;

        if( makeDigiSimLinks_ ) { // No need to do any of this if truth association was turned off in the configuration
          for( size_t stripIndex=0; stripIndex<locAmpl.size(); ++stripIndex ) {
            // Work out the amplitude from this SimHit from the difference of what it was before and what it is now
            float signalFromThisSimHit=locAmpl[stripIndex]-previousLocalAmplitude[stripIndex];
            if( signalFromThisSimHit!=0 ) { // If this SimHit had any contribution I need to record it.
              auto& associationVector=(*pDetIDAssociationInfo)[stripIndex];
              bool addNewEntry=true;
              // Make sure the hit isn't in already. I've seen this a few times, it always seems to happen in pairs so I think
              // it's something to do with the stereo strips.
              for( auto& associationInfo : associationVector ) {
                if( associationInfo.trackID==simHitIter->trackId() && associationInfo.eventID==simHitIter->eventId() ) {
                  // The hit is already in, so add this second contribution and move on
                  associationInfo.contributionToADC+=signalFromThisSimHit;
                  addNewEntry=false;
                  break;
                }
              } // end of loop over associationVector
              // If the hit wasn't already in create a new association info structure.
              if( addNewEntry ) associationVector.push_back( AssociationInfo{ simHitIter->trackId(), simHitIter->eventId(), signalFromThisSimHit, simHitGlobalIndex } );
            } // end of "if( signalFromThisSimHit!=0 )"
          } // end of loop over locAmpl strips
        } // end of "if( makeDigiSimLinks_ )"
      } // end of TOF check
    } // end for
  }
  theSiPileUpSignals->add(detID, locAmpl, thisFirstChannelWithSignal, thisLastChannelWithSignal);

  if(firstChannelsWithSignal[detID] > thisFirstChannelWithSignal) firstChannelsWithSignal[detID] = thisFirstChannelWithSignal;
  if(lastChannelsWithSignal[detID] < thisLastChannelWithSignal) lastChannelsWithSignal[detID] = thisLastChannelWithSignal;
}
void SiStripDigitizerAlgorithm::digitize ( edm::DetSet< SiStripDigi > &  outDigis,
edm::DetSet< SiStripRawDigi > &  outRawDigis,
edm::DetSet< StripDigiSimLink > &  outLink,
const StripGeomDetUnit stripdet,
edm::ESHandle< SiStripGain > &  gainHandle,
edm::ESHandle< SiStripThreshold > &  thresholdHandle,
edm::ESHandle< SiStripNoises > &  noiseHandle,
edm::ESHandle< SiStripPedestals > &  pedestalHandle 
)

Definition at line 212 of file SiStripDigitizerAlgorithm.cc.

References allBadChannels, associationInfoForDetId_, BaselineShift, cmnRMStec, cmnRMStib, cmnRMStid, cmnRMStob, CommonModeNoise, edm::DetSet< T >::data, firstChannelsWithSignal, GeomDet::geographicalId(), lastChannelsWithSignal, noise, pedOffset, edm::DetSet< T >::push_back(), DetId::rawId(), RealPedestals, SingleStripNoise, StripGeomDetUnit::specificTopology(), DetId::subdetId(), theElectronPerADC, theSiDigitalConverter, theSiNoiseAdder, theSiPileUpSignals, theSiZeroSuppress, and zeroSuppression.

                                                                           {
  unsigned int detID = det->geographicalId().rawId();
  int numStrips = (det->specificTopology()).nstrips();  

  const SiPileUpSignals::SignalMapType* theSignal(theSiPileUpSignals->getSignal(detID));  

  std::vector<float> detAmpl(numStrips, 0.);
  if(theSignal) {
    for(const auto& amp : *theSignal) {
      detAmpl[amp.first] = amp.second;
    }
  }

  //removing signal from the dead (and HIP effected) strips
  std::vector<bool>& badChannels = allBadChannels[detID];
  for(int strip =0; strip < numStrips; ++strip) if(badChannels[strip]) detAmpl[strip] = 0.;

  SiStripNoises::Range detNoiseRange = noiseHandle->getRange(detID);
  SiStripApvGain::Range detGainRange = gainHandle->getRange(detID);
  SiStripPedestals::Range detPedestalRange = pedestalHandle->getRange(detID);

// -----------------------------------------------------------

  auto& firstChannelWithSignal = firstChannelsWithSignal[detID];
  auto& lastChannelWithSignal = lastChannelsWithSignal[detID];
  auto iAssociationInfoByChannel=associationInfoForDetId_.find(detID); // Use an iterator so that I can easily remove it once finished

  if(zeroSuppression){
    if(noise){
          int RefStrip = int(numStrips/2.);
          while(RefStrip<numStrips&&badChannels[RefStrip]){ //if the refstrip is bad, I move up to when I don't find it
                RefStrip++;
          }
          if(RefStrip<numStrips){
                float noiseRMS = noiseHandle->getNoise(RefStrip,detNoiseRange);
                float gainValue = gainHandle->getStripGain(RefStrip, detGainRange);
                theSiNoiseAdder->addNoise(detAmpl,firstChannelWithSignal,lastChannelWithSignal,numStrips,noiseRMS*theElectronPerADC/gainValue);
          }
        }
    DigitalVecType digis;
    theSiZeroSuppress->suppress(theSiDigitalConverter->convert(detAmpl, gainHandle, detID), digis, detID,noiseHandle,thresholdHandle);
    // Now do the association to truth. Note that if truth association was turned off in the configuration this map
    // will be empty and the iterator will always equal associationInfoForDetId_.end().
    if( iAssociationInfoByChannel!=associationInfoForDetId_.end() ) { // make sure the readings for this DetID aren't completely from noise
      for( const auto& iDigi : digis ) {
        auto& associationInfoByChannel=iAssociationInfoByChannel->second;
        const std::vector<AssociationInfo>& associationInfo=associationInfoByChannel[iDigi.channel()];

        // Need to find the total from all sim hits, because this might not be the same as the total
        // digitised due to noise or whatever.
        float totalSimADC=0;
        for( const auto& iAssociationInfo : associationInfo ) totalSimADC+=iAssociationInfo.contributionToADC;
        // Now I know that I can loop again and create the links
        for( const auto& iAssociationInfo : associationInfo ) {
          // Note simHitGlobalIndex has +1 because TrackerHitAssociator (the only place I can find this value being used)
          // expects counting to start at 1, not 0.
          outLink.push_back( StripDigiSimLink( iDigi.channel(), iAssociationInfo.trackID, iAssociationInfo.simHitGlobalIndex+1, iAssociationInfo.eventID, iAssociationInfo.contributionToADC/totalSimADC ) );
        } // end of loop over associationInfo
      } // end of loop over the digis
    } // end of check that iAssociationInfoByChannel is a valid iterator
    outdigi.data = digis;
  }
  
  
  if(!zeroSuppression){
    //if(noise){
      // the constant pedestal offset is needed because
      //   negative adc counts are not allowed in case
      //   Pedestal and CMN subtraction is performed.
      //   The pedestal value read from the conditions
      //   is pedValue and after the pedestal subtraction
      //   the baseline is zero. The Common Mode Noise
      //   is not subtracted from the negative adc counts
      //   channels. Adding pedOffset the baseline is set
      //   to pedOffset after pedestal subtraction and CMN
      //   is subtracted to all the channels since none of
      //   them has negative adc value. The pedOffset is
      //   treated as a constant component in the CMN
      //   estimation and subtracted as CMN.
      
         
                //calculating the charge deposited on each APV and subtracting the shift
                //------------------------------------------------------
                if(BaselineShift){
                   theSiNoiseAdder->addBaselineShift(detAmpl, badChannels);
                }
                
                //Adding the strip noise
                //------------------------------------------------------                                                 
                if(noise){
                    std::vector<float> noiseRMSv;
                        noiseRMSv.clear();
                    noiseRMSv.insert(noiseRMSv.begin(),numStrips,0.);
                        
                    if(SingleStripNoise){
                            for(int strip=0; strip< numStrips; ++strip){
                                        if(!badChannels[strip]) noiseRMSv[strip] = (noiseHandle->getNoise(strip,detNoiseRange))* theElectronPerADC;
                                }
                        
                } else {
                            int RefStrip = 0; //int(numStrips/2.);
                            while(RefStrip<numStrips&&badChannels[RefStrip]){ //if the refstrip is bad, I move up to when I don't find it
                                        RefStrip++;
                                }
                                if(RefStrip<numStrips){
                                        float noiseRMS = noiseHandle->getNoise(RefStrip,detNoiseRange) *theElectronPerADC;
                                        for(int strip=0; strip< numStrips; ++strip){
                                        if(!badChannels[strip]) noiseRMSv[strip] = noiseRMS;
                                        }
                                }
                        }
                        
                        theSiNoiseAdder->addNoiseVR(detAmpl, noiseRMSv);
                }                       
                
                //adding the CMN
                //------------------------------------------------------
        if(CommonModeNoise){
                  float cmnRMS = 0.;
                  DetId  detId(detID);
                  uint32_t SubDet = detId.subdetId();
                  if(SubDet==3){
                    cmnRMS = cmnRMStib;
                  }else if(SubDet==4){
                    cmnRMS = cmnRMStid;
                  }else if(SubDet==5){
                    cmnRMS = cmnRMStob;
                  }else if(SubDet==6){
                    cmnRMS = cmnRMStec;
                  }
                  cmnRMS *= theElectronPerADC;
          theSiNoiseAdder->addCMNoise(detAmpl, cmnRMS, badChannels);
                }
                
                        
                //Adding the pedestals
                //------------------------------------------------------
                
                std::vector<float> vPeds;
                vPeds.clear();
                vPeds.insert(vPeds.begin(),numStrips,0.);
                
                if(RealPedestals){
                    for(int strip=0; strip< numStrips; ++strip){
                           if(!badChannels[strip]) vPeds[strip] = (pedestalHandle->getPed(strip,detPedestalRange)+pedOffset)* theElectronPerADC;
                    }
        } else {
                    for(int strip=0; strip< numStrips; ++strip){
                          if(!badChannels[strip]) vPeds[strip] = pedOffset* theElectronPerADC;
                        }
                }
                
                theSiNoiseAdder->addPedestals(detAmpl, vPeds);  
                
                 
        //if(!RealPedestals&&!CommonModeNoise&&!noise&&!BaselineShift&&!APVSaturationFromHIP){
    //  edm::LogWarning("SiStripDigitizer")<<"You are running the digitizer without Noise generation and without applying Zero Suppression. ARE YOU SURE???";
    //}else{                                                     
    
    DigitalRawVecType rawdigis = theSiDigitalConverter->convertRaw(detAmpl, gainHandle, detID);

    // Now do the association to truth. Note that if truth association was turned off in the configuration this map
    // will be empty and the iterator will always equal associationInfoForDetId_.end().
    if( iAssociationInfoByChannel!=associationInfoForDetId_.end() ) { // make sure the readings for this DetID aren't completely from noise
      // N.B. For the raw digis the channel is inferred from the position in the vector.
      // I'VE NOT TESTED THIS YET!!!!!
      // ToDo Test this properly.
      for( size_t channel=0; channel<rawdigis.size(); ++channel ) {
        auto& associationInfoByChannel=iAssociationInfoByChannel->second;
        const auto iAssociationInfo=associationInfoByChannel.find(channel);
        if( iAssociationInfo==associationInfoByChannel.end() ) continue; // Skip if there is no sim information for this channel (i.e. it's all noise)
        const std::vector<AssociationInfo>& associationInfo=iAssociationInfo->second;

        // Need to find the total from all sim hits, because this might not be the same as the total
        // digitised due to noise or whatever.
        float totalSimADC=0;
        for( const auto& iAssociationInfo : associationInfo ) totalSimADC+=iAssociationInfo.contributionToADC;
        // Now I know that I can loop again and create the links
        for( const auto& iAssociationInfo : associationInfo ) {
          // Note simHitGlobalIndex has +1 because TrackerHitAssociator (the only place I can find this value being used)
          // expects counting to start at 1, not 0.
          outLink.push_back( StripDigiSimLink( channel, iAssociationInfo.trackID, iAssociationInfo.simHitGlobalIndex+1, iAssociationInfo.eventID, iAssociationInfo.contributionToADC/totalSimADC ) );
        } // end of loop over associationInfo
      } // end of loop over the digis
    } // end of check that iAssociationInfoByChannel is a valid iterator

    outrawdigi.data = rawdigis;
        
        //}
  }

  // Now that I've finished with this entry in the map of associations, I can remove it.
  // Note that there might not be an association if the ADC reading is from noise in which
  // case associationIsValid will be false.
  if( iAssociationInfoByChannel!=associationInfoForDetId_.end() ) associationInfoForDetId_.erase(iAssociationInfoByChannel);
}
void SiStripDigitizerAlgorithm::initializeDetUnit ( StripGeomDetUnit det,
const edm::EventSetup iSetup 
)

Definition at line 72 of file SiStripDigitizerAlgorithm.cc.

References allBadChannels, firstChannelsWithSignal, SiStripBadStrip::data::firstStrip, GeomDet::geographicalId(), edm::EventSetup::get(), lastChannelsWithSignal, SiStripBadStrip::data::range, DetId::rawId(), and StripGeomDetUnit::specificTopology().

                                                                                               {
  edm::ESHandle<SiStripBadStrip> deadChannelHandle;
  iSetup.get<SiStripBadChannelRcd>().get(deadChannelHandle);

  unsigned int detId = det->geographicalId().rawId();
  int numStrips = (det->specificTopology()).nstrips();  

  SiStripBadStrip::Range detBadStripRange = deadChannelHandle->getRange(detId);
  //storing the bad strip of the the module. the module is not removed but just signal put to 0
  std::vector<bool>& badChannels = allBadChannels[detId];
  badChannels.clear();
  badChannels.insert(badChannels.begin(), numStrips, false);
  for(SiStripBadStrip::ContainerIterator it = detBadStripRange.first; it != detBadStripRange.second; ++it) {
    SiStripBadStrip::data fs = deadChannelHandle->decode(*it);
    for(int strip = fs.firstStrip; strip < fs.firstStrip + fs.range; ++strip) badChannels[strip] = true;
  }
  firstChannelsWithSignal[detId] = numStrips;
  lastChannelsWithSignal[detId]= 0;
}
void SiStripDigitizerAlgorithm::initializeEvent ( const edm::EventSetup iSetup)

Definition at line 93 of file SiStripDigitizerAlgorithm.cc.

References associationInfoForDetId_, edm::EventSetup::get(), edm::EventSetup::getData(), lorentzAngleHandle, lorentzAngleName, pdt, setParticleDataTable(), and theSiPileUpSignals.

                                                                      {
  theSiPileUpSignals->reset();
  // This should be clear by after all calls to digitize(), but I might as well make sure
  associationInfoForDetId_.clear();

  //get gain noise pedestal lorentzAngle from ES handle
  edm::ESHandle<ParticleDataTable> pdt;
  iSetup.getData(pdt);
  setParticleDataTable(&*pdt);
  iSetup.get<SiStripLorentzAngleSimRcd>().get(lorentzAngleName,lorentzAngleHandle);
}
void SiStripDigitizerAlgorithm::setParticleDataTable ( const ParticleDataTable pardt) [inline]

Definition at line 86 of file SiStripDigitizerAlgorithm.h.

References pdt, and theSiHitDigitizer.

Referenced by initializeEvent().

                                                             {
        theSiHitDigitizer->setParticleDataTable(pardt); 
        pdt= pardt; 
  }

Member Data Documentation

std::map<unsigned int, std::vector<bool> > SiStripDigitizerAlgorithm::allBadChannels [private]

Definition at line 130 of file SiStripDigitizerAlgorithm.h.

Referenced by accumulateSimHits(), digitize(), and initializeDetUnit().

Definition at line 106 of file SiStripDigitizerAlgorithm.h.

Referenced by accumulateSimHits().

Definition at line 98 of file SiStripDigitizerAlgorithm.h.

Referenced by accumulateSimHits().

Structure that holds the information on the SimTrack contributions. Only filled if makeDigiSimLinks_ is true.

Definition at line 151 of file SiStripDigitizerAlgorithm.h.

Referenced by accumulateSimHits(), digitize(), and initializeEvent().

Definition at line 105 of file SiStripDigitizerAlgorithm.h.

Referenced by digitize().

const double SiStripDigitizerAlgorithm::cmnRMStec [private]

Definition at line 97 of file SiStripDigitizerAlgorithm.h.

Referenced by digitize().

const double SiStripDigitizerAlgorithm::cmnRMStib [private]

Definition at line 94 of file SiStripDigitizerAlgorithm.h.

Referenced by digitize().

const double SiStripDigitizerAlgorithm::cmnRMStid [private]

Definition at line 96 of file SiStripDigitizerAlgorithm.h.

Referenced by digitize().

const double SiStripDigitizerAlgorithm::cmnRMStob [private]

Definition at line 95 of file SiStripDigitizerAlgorithm.h.

Referenced by digitize().

Definition at line 104 of file SiStripDigitizerAlgorithm.h.

Referenced by digitize().

Definition at line 114 of file SiStripDigitizerAlgorithm.h.

Referenced by accumulateSimHits().

std::map<unsigned int, size_t> SiStripDigitizerAlgorithm::firstChannelsWithSignal [private]

Definition at line 132 of file SiStripDigitizerAlgorithm.h.

Referenced by accumulateSimHits(), digitize(), and initializeDetUnit().

Definition at line 115 of file SiStripDigitizerAlgorithm.h.

Referenced by accumulateSimHits().

std::map<unsigned int, size_t> SiStripDigitizerAlgorithm::lastChannelsWithSignal [private]

Definition at line 133 of file SiStripDigitizerAlgorithm.h.

Referenced by accumulateSimHits(), digitize(), and initializeDetUnit().

Definition at line 136 of file SiStripDigitizerAlgorithm.h.

Referenced by accumulateSimHits(), and initializeEvent().

const std::string SiStripDigitizerAlgorithm::lorentzAngleName [private]

Definition at line 92 of file SiStripDigitizerAlgorithm.h.

Referenced by initializeEvent().

Definition at line 99 of file SiStripDigitizerAlgorithm.h.

Referenced by accumulateSimHits().

const bool SiStripDigitizerAlgorithm::noise [private]

Definition at line 101 of file SiStripDigitizerAlgorithm.h.

Referenced by digitize().

Definition at line 119 of file SiStripDigitizerAlgorithm.h.

Referenced by accumulateSimHits().

Definition at line 100 of file SiStripDigitizerAlgorithm.h.

Referenced by SiStripDigitizerAlgorithm().

const double SiStripDigitizerAlgorithm::pedOffset [private]

Definition at line 116 of file SiStripDigitizerAlgorithm.h.

Referenced by digitize().

Definition at line 102 of file SiStripDigitizerAlgorithm.h.

Referenced by digitize().

Definition at line 103 of file SiStripDigitizerAlgorithm.h.

Referenced by digitize().

Definition at line 110 of file SiStripDigitizerAlgorithm.h.

Referenced by digitize().

Definition at line 108 of file SiStripDigitizerAlgorithm.h.

const std::unique_ptr<CLHEP::RandFlat> SiStripDigitizerAlgorithm::theFlatDistribution [private]

Definition at line 127 of file SiStripDigitizerAlgorithm.h.

Referenced by accumulateSimHits().

Definition at line 124 of file SiStripDigitizerAlgorithm.h.

Referenced by digitize().

Definition at line 121 of file SiStripDigitizerAlgorithm.h.

Referenced by accumulateSimHits(), and setParticleDataTable().

Definition at line 123 of file SiStripDigitizerAlgorithm.h.

Referenced by digitize().

Definition at line 122 of file SiStripDigitizerAlgorithm.h.

Referenced by accumulateSimHits(), digitize(), and initializeEvent().

Definition at line 125 of file SiStripDigitizerAlgorithm.h.

Referenced by digitize().

Definition at line 93 of file SiStripDigitizerAlgorithm.h.

Definition at line 112 of file SiStripDigitizerAlgorithm.h.

Definition at line 111 of file SiStripDigitizerAlgorithm.h.

const double SiStripDigitizerAlgorithm::tofCut [private]

Definition at line 113 of file SiStripDigitizerAlgorithm.h.

Referenced by accumulateSimHits().

Definition at line 109 of file SiStripDigitizerAlgorithm.h.

Referenced by accumulateSimHits(), and digitize().