Changeset 13002 for trunk/Mars/mhist
- Timestamp:
- 03/07/12 16:27:10 (13 years ago)
- Location:
- trunk/Mars/mhist
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Mars/mhist/MHCamEvent.cc
r12922 r13002 51 51 // MHCamEvent myhist("Titele;;y [cm]"); 52 52 // 53 // Class Version 3: 54 // ---------------- 55 // + fNameSub 56 // 53 57 ///////////////////////////////////////////////////////////////////////////// 54 58 #include "MHCamEvent.h" … … 91 95 // 92 96 MHCamEvent::MHCamEvent(const char *name, const char *title) 93 : fSum(NULL), fErr(NULL), fEvt(NULL), f Type(0), fErrorSpread(kTRUE), fErrorRelative(kFALSE),97 : fSum(NULL), fErr(NULL), fEvt(NULL), fSub(0), fType(0), fErrorSpread(kTRUE), fErrorRelative(kFALSE), 94 98 fThreshold(0), fUseThreshold(0) 95 99 { … … 104 108 // 105 109 MHCamEvent::MHCamEvent(Int_t type, const char *name, const char *title) 106 : fSum(NULL), fErr(NULL), fEvt(NULL), f Type(type), fErrorSpread(kTRUE), fErrorRelative(kFALSE),110 : fSum(NULL), fErr(NULL), fEvt(NULL), fSub(0), fType(type), fErrorSpread(kTRUE), fErrorRelative(kFALSE), 107 111 fThreshold(0), fUseThreshold(0) 108 112 { … … 155 159 Bool_t MHCamEvent::SetupFill(const MParList *plist) 156 160 { 157 fEvt = (MCamEvent*)plist->FindObject(fNameEvt, "MCamEvent");161 fEvt = dynamic_cast<MCamEvent*>(plist->FindObject(fNameEvt, "MCamEvent")); 158 162 if (!fEvt) 159 163 { … … 166 170 } 167 171 172 fSub = 0; 173 if (!fNameSub.IsNull()) 174 { 175 fSub = dynamic_cast<MCamEvent*>(plist->FindObject(fNameSub, "MCamEvent")); 176 if (!fSub) 177 { 178 *fLog << err << GetDescriptor() << ": No " << fNameSub <<" [MCamEvent] available..." << endl; 179 return kFALSE; 180 } 181 *fLog << inf << GetDescriptor() << ": Will subtract '" << fNameSub << "'" << endl; 182 } 183 168 184 fSum->Reset(); 169 185 … … 209 225 { 210 226 case kNoBound: 211 fSum->AddCamContent(*evt, fType); 227 if (fSub) 228 fSum->AddCamDifference(*evt, *fSub, fType); 229 else 230 fSum->AddCamContent(*evt, fType, w); 212 231 break; 213 232 … … 226 245 227 246 case kMeanShift: 228 fSum->AddMeanShift(*evt, fType );247 fSum->AddMeanShift(*evt, fType, w); 229 248 break; 230 249 231 250 case kMedianShift: 232 fSum->AddMedianShift(*evt, fType );251 fSum->AddMedianShift(*evt, fType, w); 233 252 break; 234 253 -
trunk/Mars/mhist/MHCamEvent.h
r12922 r13002 19 19 MHCamera *fErr; //! storing the err 20 20 MCamEvent *fEvt; //! the current event 21 MCamEvent *fSub; //! the event to be subtracted 21 22 22 23 TString fNameEvt; // Name of MCamEvent to fill into histogram 24 TString fNameSub; // Name of MCamEvent to fill into histogram 23 25 TString fNameGeom; // Name of geometry container 24 26 … … 49 51 50 52 void SetNameEvt(const TString name) { fNameEvt = name; } 53 void SetNameSub(const TString name) { fNameSub = name; } 51 54 void SetNameGeom(const TString name) { fNameGeom = name; } 52 55 void SetType(Int_t type) { fType = type; } … … 73 76 void RecursiveRemove(TObject *obj); 74 77 75 ClassDef(MHCamEvent, 2) // Histogram to sum camera events78 ClassDef(MHCamEvent, 3) // Histogram to sum camera events 76 79 }; 77 80
Note:
See TracChangeset
for help on using the changeset viewer.