Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-09-16 03:24:10

0001 #ifndef DTMEANTIMER_H
0002 #define DTMEANTIMER_H
0003 
0004 /** \class DTMeanTimer
0005  *
0006  * Description:
0007  *  Class to compute mean timer (also known as Tmax) for a triplet of DT layers.
0008  *
0009  * \author : Stefano Lacaprara - INFN LNL <stefano.lacaprara@pd.infn.it>
0010  *
0011  * Modification:
0012  *
0013  */
0014 
0015 /* Base Class Headers */
0016 
0017 /* Collaborating Class Declarations */
0018 class DTSuperLayer;
0019 class DTTTrigBaseSync;
0020 #include "DataFormats/Common/interface/Handle.h"
0021 namespace edm {
0022   class Event;
0023   class EventSetup;
0024 }  // namespace edm
0025 #include "DataFormats/DTRecHit/interface/DTRecHitCollection.h"
0026 
0027 /* C++ Headers */
0028 #include <map>
0029 #include <vector>
0030 
0031 /* ====================================================================== */
0032 
0033 /* Class DTMeanTimer Interface */
0034 
0035 class DTMeanTimer {
0036 public:
0037   /// Constructor: it takes a list of hits of a SL and a reference to the SL id
0038   DTMeanTimer(const DTSuperLayer* sl, edm::Handle<DTRecHitCollection>& hits, DTTTrigBaseSync* sync);
0039 
0040   /// Constructor: alternative way to pass a list of hits
0041   DTMeanTimer(const DTSuperLayer* sl, std::vector<DTRecHit1D>& hits, DTTTrigBaseSync* sync);
0042 
0043   /* Destructor */
0044   ~DTMeanTimer();
0045 
0046   /* Operations */
0047   /** return a vector of meanTimers calculated from the hits. For 4 hits in 4
0048  * different layers, eg, 2 MT are computed , one for the first 3 layers and one
0049  * for the last 3 layers. No selection on hits is done. */
0050   std::vector<double> run() const;
0051 
0052 private:
0053   typedef std::map<int, double> hitColl;  // map between wire number and time
0054 
0055   std::vector<double> computeMT(hitColl hits1, hitColl hits2, hitColl hits3) const;
0056   double tMax(const double& t1, const double& t2, const double& t3) const;
0057 
0058 private:
0059   int theNumWires;  // max number of wires in this SL
0060 
0061   hitColl hitsLay[4];  // four hits containers for the 4 layers
0062 
0063 protected:
0064 };
0065 #endif  // DTMEANTIMER_H