Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:25:39

0001 /**
0002    \file
0003    Declaration of class EcalSeverityLevelAlgo
0004 
0005    \author Stefano Argiro
0006    \date 10 Jan 2011
0007 */
0008 
0009 #ifndef __EcalSeverityLevelAlgo_h_
0010 #define __EcalSeverityLevelAlgo_h_
0011 
0012 #include "FWCore/Framework/interface/Frameworkfwd.h"
0013 #include "DataFormats/EcalRecHit/interface/EcalRecHitCollections.h"
0014 #include "DataFormats/EcalRecHit/interface/EcalSeverityLevel.h"
0015 #include "CondFormats/EcalObjects/interface/EcalChannelStatus.h"
0016 
0017 #include <vector>
0018 
0019 /**
0020      Combine information from EcalRecHit::Flag and
0021      DBStatus into a simpler EcalSeverityLevel flag 
0022      defined here.
0023 
0024      Instances of this class are supposed to be retrieved from the EventSetup
0025      via the EcalSeverityLevelESProducer.
0026      Do not cache the algorithm, or the channel status will not be updated.
0027      
0028  */
0029 
0030 class EcalRecHit;
0031 class DetId;
0032 
0033 class EcalSeverityLevelAlgo {
0034 public:
0035   explicit EcalSeverityLevelAlgo(const edm::ParameterSet& p);
0036 
0037   /// Evaluate status from id use channelStatus from DB
0038   EcalSeverityLevel::SeverityLevel severityLevel(const DetId& id) const;
0039 
0040   /** If the id is in the collection, use the EcalRecHit::Flag
0041       else use the channelStatus from DB 
0042    */
0043   EcalSeverityLevel::SeverityLevel severityLevel(const DetId& id, const EcalRecHitCollection& rhs) const;
0044 
0045   /// Evaluate status from rechit, using its EcalRecHit::Flag
0046   EcalSeverityLevel::SeverityLevel severityLevel(const EcalRecHit& rh) const;
0047 
0048   /// Set the ChannelStatus record.
0049   void setChannelStatus(const EcalChannelStatus& chs) { chStatus_ = &chs; }
0050 
0051 private:
0052   /// Configure which EcalRecHit::Flag is mapped into which EcalSeverityLevel
0053   /** The position in the vector is the EcalSeverityLevel
0054       The content defines which EcalRecHit::Flag should be mapped into that EcalSeverityLevel
0055       in a bit-wise way */
0056   std::vector<uint32_t> flagMask_;
0057 
0058   /// Configure which DBStatus::Flag is mapped into which EcalSeverityLevel
0059   /** The position in the vector is the EcalSeverityLevel
0060       The content defines which EcalRecHit::Flag should be mapped into that EcalSeverityLevel 
0061       in a bit-wise way*/
0062   std::vector<uint32_t> dbstatusMask_;
0063 
0064   /// Return kTime only if the rechit is flagged kOutOfTime and E>timeThresh_
0065   float timeThresh_;
0066 
0067   const EcalChannelStatus* chStatus_;
0068 };
0069 
0070 #endif  // __EcalSeverityLevelAlgo_h_
0071 
0072 // Configure (x)emacs for this file ...
0073 // Local Variables:
0074 // mode:c++
0075 // compile-command: "cd ..; scram b -k"
0076 // End: