Changeset 2571 for trunk/MagicSoft/Mars
- Timestamp:
- 11/26/03 16:05:06 (21 years ago)
- Location:
- trunk/MagicSoft/Mars
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/Changelog
r2568 r2571 4 4 5 5 -*-*- END OF LINE -*-*- 6 2003/11/26: Thomas Bretz 7 8 * mhist/MHVsTime.[h,cc]: 9 - implemented usage of Event number 10 11 12 6 13 2003/11/25: Thomas Bretz 7 14 -
trunk/MagicSoft/Mars/mhist/MHVsTime.cc
r2557 r2571 47 47 #include "MParList.h" 48 48 #include "MDataChain.h" 49 #include "MRawEvtHeader.h" 49 50 50 51 ClassImp(MHVsTime); … … 53 54 54 55 static const TString gsDefName = "MHVsTime"; 55 static const TString gsDefTitle = "Container for a graph vs time ";56 static const TString gsDefTitle = "Container for a graph vs time/evtnumber"; 56 57 57 58 // -------------------------------------------------------------------------- … … 116 117 117 118 TString title(fData ? GetRule() : (TString)"Histogram"); 118 title += " vs Time"; 119 title += " vs "; 120 title += fUseEventNumber ? "Event Number" : "Time"; 119 121 120 122 fGraph->SetNameTitle(fName, title); … … 149 151 Bool_t MHVsTime::Fill(const MParContainer *par, const Stat_t w) 150 152 { 151 const MTime *t = dynamic_cast<const MTime*>(par); 152 if (!t) 153 { 154 *fLog << err << dbginf << "No MTime found..." << endl; 155 return kFALSE; 153 Double_t t = 0; 154 if (fUseEventNumber) 155 { 156 const MRawEvtHeader *h = dynamic_cast<const MRawEvtHeader*>(par); 157 t = h ? h->GetDAQEvtNumber() : fGraph->GetN(); 158 } 159 else 160 { 161 const MTime *tm = dynamic_cast<const MTime*>(par); 162 if (!tm) 163 { 164 *fLog << err << dbginf << "No MTime found..." << endl; 165 return kFALSE; 166 } 167 const Double_t T = (*tm);///3600; 168 t = T>12*3600?T-24*3600:T; 156 169 } 157 170 158 171 const Double_t v = fData->GetValue()*fScale; 159 const Double_t T = (*t);///3600; 160 161 fGraph->SetPoint(fGraph->GetN(), T>12*3600?T-24*3600:T, v); 172 173 fGraph->SetPoint(fGraph->GetN(), t, v); 162 174 163 175 return kTRUE; … … 191 203 TString str(opt); 192 204 193 fGraph->GetHistogram()->SetXTitle("Time"); 205 if (fUseEventNumber) 206 fGraph->GetHistogram()->SetXTitle("Event Number"); 207 else 208 { 209 fGraph->GetHistogram()->SetXTitle("Time"); 210 fGraph->GetHistogram()->GetXaxis()->SetTimeFormat("%H:%M:%S"); 211 fGraph->GetHistogram()->GetXaxis()->SetTimeDisplay(1); 212 fGraph->GetHistogram()->GetXaxis()->SetLabelSize(0.033); 213 } 194 214 fGraph->GetHistogram()->SetYTitle(GetRule()); 195 fGraph->GetHistogram()->GetXaxis()->SetTimeFormat("%H:%M:%S");196 fGraph->GetHistogram()->GetXaxis()->SetTimeDisplay(1);197 fGraph->GetHistogram()->GetXaxis()->SetLabelSize(0.033);198 215 fGraph->Draw("AP"); 199 216 if (fGraph->TestBit(kIsLogy)) … … 213 230 MHVsTime *h=new MHVsTime(fData ? (const char*)GetRule() : NULL); 214 231 h->SetScale(fScale); 232 if (fUseEventNumber) 233 h->SetUseEventNumber(); 215 234 return h; 216 235 } -
trunk/MagicSoft/Mars/mhist/MHVsTime.h
r2557 r2571 18 18 19 19 enum { 20 kIsLogy = BIT(18) 20 kIsLogy = BIT(18), 21 kUseEventNumber = BIT(20) 21 22 }; 23 24 Bool_t fUseEventNumber; 22 25 23 26 public: … … 46 49 TGraph *GetGraph() { return fGraph; } 47 50 51 void SetUseEventNumber(Bool_t use = kTRUE) { fUseEventNumber = use; } 48 52 49 53 void Draw(Option_t *opt=NULL);
Note:
See TracChangeset
for help on using the changeset viewer.