CMS 3D CMS Logo

/afs/cern.ch/work/a/aaltunda/public/www/CMSSW_6_2_5/src/TBDataFormats/HcalTBObjects/src/HcalTBTiming.cc

Go to the documentation of this file.
00001 #include "TBDataFormats/HcalTBObjects/interface/HcalTBTiming.h"
00002 
00003 using namespace std;
00004 
00005   HcalTBTiming::HcalTBTiming() :
00006     triggerTime_(0),
00007     ttcL1Atime_(0),
00008     laserFlash_(0),
00009     qiePhase_(0),
00010     TOF1Stime_(0),
00011     TOF1Jtime_(0),
00012     TOF2Stime_(0),
00013     TOF2Jtime_(0),
00014     beamCoincidenceHits_(),
00015     m1hits_(),
00016     m2hits_(),
00017     m3hits_(),
00018     s1hits_(),
00019     s2hits_(),
00020     s3hits_(),
00021     s4hits_(),
00022     bh1hits_(),
00023     bh2hits_(),
00024     bh3hits_(),
00025     bh4hits_() {
00026     for (int i=0;i<32;i++)V775_[i]=-1;
00027   }
00028 
00029   void HcalTBTiming::setTimes (const double trigger_time,
00030                                const double ttc_l1a_time,
00031                                const double laser_flash,
00032                                const double qie_phase,
00033                                const double TOF1S_time,
00034                                const double TOF1J_time,
00035                                const double TOF2S_time,
00036                                const double TOF2J_time) {
00037     triggerTime_     = trigger_time;
00038     ttcL1Atime_      = ttc_l1a_time;
00039     laserFlash_      = laser_flash;
00040     qiePhase_        = qie_phase;
00041     TOF1Stime_       = TOF1S_time;
00042     TOF1Jtime_       = TOF1J_time;
00043     TOF2Stime_       = TOF2S_time;
00044     TOF2Jtime_       = TOF2J_time;
00045   }
00046 
00047   void HcalTBTiming::setHits  (const std::vector<double>& m1hits,
00048                                const std::vector<double>& m2hits,
00049                                const std::vector<double>& m3hits,
00050                                const std::vector<double>& s1hits,
00051                                const std::vector<double>& s2hits,
00052                                const std::vector<double>& s3hits,
00053                                const std::vector<double>& s4hits,
00054                                const std::vector<double>& bh1hits,
00055                                const std::vector<double>& bh2hits,
00056                                const std::vector<double>& bh3hits,
00057                                const std::vector<double>& bh4hits,
00058                                const std::vector<double>& beamCoincidenceHits) {
00059     m1hits_ = m1hits;
00060     m2hits_ = m2hits;
00061     m3hits_ = m3hits;
00062 
00063     s1hits_ = s1hits;
00064     s2hits_ = s2hits;
00065     s3hits_ = s3hits;
00066     s4hits_ = s4hits;
00067 
00068     bh1hits_ = bh1hits;
00069     bh2hits_ = bh2hits;
00070     bh3hits_ = bh3hits;
00071     bh4hits_ = bh4hits;
00072     beamCoincidenceHits_ = beamCoincidenceHits;
00073   }
00074 
00075     void HcalTBTiming::setV775 (int *V775)
00076  {
00077     for (int i=0;i<32;i++)V775_[i]=V775[i];
00078  }
00079 
00080   
00081   ostream& operator<<(ostream& s, const HcalTBTiming& htbtmg) {
00082 
00083     s << "Trigger time     = " << htbtmg.triggerTime() << endl;
00084     s << "TTC L1A time     = " << htbtmg.ttcL1Atime() << endl;
00085     s << "Laser Flash      = " << htbtmg.laserFlash() << endl;
00086     s << "QIE Phase        = " << htbtmg.qiePhase() << endl;
00087     s << "TOF1S            = " << htbtmg.TOF1Stime() << endl;
00088     s << "TOF1J            = " << htbtmg.TOF1Jtime() << endl;
00089     s << "TOF2S            = " << htbtmg.TOF2Stime() << endl;
00090     s << "TOF2J            = " << htbtmg.TOF2Jtime() << endl;
00091 
00092     s << "M1 hits: ";
00093     for (int i=0; i<htbtmg.M1Count(); i++) {
00094       if (i) s << ", ";
00095       s << htbtmg.M1Hits(i);
00096     }
00097     s << endl;
00098 
00099     s << "M2 hits: ";
00100     for (int i=0; i<htbtmg.M2Count(); i++) {
00101       if (i) s << ", ";
00102       s << htbtmg.M2Hits(i);
00103     }
00104     s << endl;
00105 
00106     s << "M3 hits: ";
00107     for (int i=0; i<htbtmg.M3Count(); i++) {
00108       if (i) s << ", ";
00109       s << htbtmg.M3Hits(i);
00110     }
00111     s << endl;
00112 
00113     s << "S1 hits: ";
00114     for (int i=0; i<htbtmg.S1Count(); i++) {
00115       if (i) s << ", ";
00116       s << htbtmg.S1Hits(i);
00117     }
00118     s << endl;
00119 
00120     s << "S2 hits: ";
00121     for (int i=0; i<htbtmg.S2Count(); i++) {
00122       if (i) s << ", ";
00123       s << htbtmg.S2Hits(i);
00124     }
00125     s << endl;
00126 
00127     s << "S3 hits: ";
00128     for (int i=0; i<htbtmg.S3Count(); i++) {
00129       if (i) s << ", ";
00130       s << htbtmg.S3Hits(i);
00131     }
00132     s << endl;
00133 
00134     s << "S4 hits: ";
00135     for (int i=0; i<htbtmg.S4Count(); i++) {
00136       if (i) s << ", ";
00137       s << htbtmg.S4Hits(i);
00138     }
00139     s << endl;
00140 
00141     s << "BH1 hits: ";
00142     for (int i=0; i<htbtmg.BH1Count(); i++) {
00143       if (i) s << ", ";
00144       s << htbtmg.BH1Hits(i);
00145     }
00146     s << endl;
00147 
00148     s << "BH2 hits: ";
00149     for (int i=0; i<htbtmg.BH2Count(); i++) {
00150       if (i) s << ", ";
00151       s << htbtmg.BH2Hits(i);
00152     }
00153     s << endl;
00154 
00155     s << "BH3 hits: ";
00156     for (int i=0; i<htbtmg.BH3Count(); i++) {
00157       if (i) s << ", ";
00158       s << htbtmg.BH3Hits(i);
00159     }
00160     s << endl;
00161 
00162     s << "BH4 hits: ";
00163     for (int i=0; i<htbtmg.BH4Count(); i++) {
00164       if (i) s << ", ";
00165       s << htbtmg.BH4Hits(i);
00166     }
00167     s << endl;
00168 
00169     s << "Beam Coincidence hits: ";
00170     for (int i=0; i<htbtmg.BeamCoincidenceCount(); i++) {
00171       if (i) s << ", ";
00172       s << htbtmg.BeamCoincidenceHits(i);
00173     }
00174     s << endl;
00175 
00176     return s;
00177   }