Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 13:33:58

0001 /**
0002    \file
0003    Declaration of class EcalTools
0004 
0005    \author Stefano Argiro
0006    \date 11 Jan 2011
0007 */
0008 
0009 #ifndef __EcalTools_h_
0010 #define __EcalTools_h_
0011 
0012 #include "DataFormats/DetId/interface/DetId.h"
0013 #include "DataFormats/EcalRecHit/interface/EcalRecHitCollections.h"
0014 #include "CondFormats/EcalObjects/interface/EcalChannelStatus.h"
0015 #include "RecoEcal/EgammaCoreTools/interface/EcalNextToDeadChannel.h"
0016 #include "FWCore/Framework/interface/Frameworkfwd.h"
0017 
0018 class EcalTools {
0019 public:
0020   /// the good old 1-e4/e1. Ignore hits below recHitThreshold
0021   static float swissCross(const DetId& id,
0022                           const EcalRecHitCollection& recHits,
0023                           float recHitThreshold,
0024                           bool avoidIeta85 = true);
0025 
0026   /// true if the channel is near a dead one (in the 3x3)
0027   /** This function will use the ChannelStatus record to determine
0028       if the channel is next to a dead one, using bit 12 of the
0029       channel status word
0030    */
0031   static bool isNextToDead(const DetId& id, const EcalNextToDeadChannel& es);
0032 
0033   /// same as isNextToDead, but will use information from the neighbour
0034   /** Looks at neighbours in 3x3 and returns true if one of them has
0035       chStatus above chStatusThreshold.
0036       Use sparingly, slow. Normally isNextToDead() should be used instead.
0037         
0038    */
0039 
0040   static bool isNextToDeadFromNeighbours(const DetId& id, const EcalChannelStatus& chs, int chStatusThreshold);
0041 
0042   /// true if near a crack or ecal border
0043   static bool isNextToBoundary(const DetId& id);
0044 
0045   /// return true if the channel at offsets dx,dy is dead
0046   static bool deadNeighbour(const DetId& id, const EcalChannelStatus& chs, int chStatusThreshold, int dx, int dy);
0047 
0048   /// identify HGCal cells
0049   static inline bool isHGCalDet(DetId::Detector thedet) {
0050     return (thedet == DetId::Forward || thedet == DetId::Hcal || thedet == DetId::HGCalEE ||
0051             thedet == DetId::HGCalHSi || thedet == DetId::HGCalHSc);
0052   }
0053 
0054 private:
0055   static float recHitE(const DetId id, const EcalRecHitCollection& recHits);
0056   static float recHitE(const DetId id, const EcalRecHitCollection& recHits, int dEta, int dPhi);
0057   static float recHitApproxEt(const DetId id, const EcalRecHitCollection& recHits);
0058 };
0059 
0060 #endif  // __EcalTools_h_
0061 
0062 // Configure (x)emacs for this file ...
0063 // Local Variables:
0064 // mode:c++
0065 // compile-command: "scram b -k"
0066 // End: