Changeset 4218
- Timestamp:
- 05/27/04 16:38:48 (21 years ago)
- Location:
- trunk/MagicSoft/Mars/mtemp/mifae
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/mtemp/mifae/library/MHillasDisplay.cc
r4211 r4218 111 111 *fLog << warn << "MHillasDisplay::PreProcess Warning: MSrcPosCam object not found" << endl; 112 112 113 // Look for the MIslands container 114 if(!fIslands) 113 // Look for the MIslands container 114 if (strlen(fIslName) > 0) 115 fIslands = (MIslands*)pList->FindObject(AddSerialNumber(fIslName)); 116 else 117 fIslands = (MIslands*)pList->FindObject(AddSerialNumber("MIslands")); 118 if (!fIslands) 119 { 120 *fLog << dbginf << "MIslands not found... aborting." << endl; 121 return kFALSE; 122 } 123 124 return kTRUE; 125 126 /* if(!fIslands) 115 127 fIslands = (MIslands*)pList->FindObject(AddSerialNumber("MIslands"), "MIslands"); 116 128 if(!fIslands) 117 129 *fLog << warn << "MHillasDisplay::PreProcess Warning: MIslands object not found" << endl; 118 119 return kTRUE;130 131 return kTRUE;*/ 120 132 } 121 133 // ------------------------------------------------------------------------- -
trunk/MagicSoft/Mars/mtemp/mifae/library/MHillasDisplay.h
r4202 r4218 21 21 MIslands* fIslands; // pointer to the islands 22 22 23 TString fIslName; 24 23 25 virtual Int_t PreProcess(MParList *plist); 24 26 virtual Int_t Process(); 27 25 28 26 29 public: … … 33 36 void SetSrcPos(MSrcPosCam* srcpos) {fSrcPos=srcpos;} 34 37 void SetIslands(MIslands* islands) {fIslands=islands;} 35 38 39 void SetIslandsName(TString inname) {fIslName = inname;} 40 36 41 virtual void Paint(Option_t* option); 37 42 38 43 ClassDef(MHillasDisplay, 0) // task to display cleaned events with hillas parameters 39 };44 }; 40 45 41 46 #endif -
trunk/MagicSoft/Mars/mtemp/mifae/library/MIslandCalc.cc
r3976 r4218 3 3 ! 4 4 ! Author(s): Ester Aliu, 2/2004 <aliu@ifae.es> 5 ! 5 ! 6 ! Last Update: 5/2004 6 7 ! 7 8 \* ======================================================================== */ … … 18 19 // - fPixNum[20]; // number of pixels in the island 19 20 // - fSigToNoise[20]; // signal to noise of the island 20 // - fTimeHi[20][577] // mean of the arrival time in the hi gain 21 // - fTimeLo[20][577] // mean of the arrival time in the lo gain 22 // - fTimeSpreadHi[20]; // mean arrival time spread of the island 23 // - fTimeSpreadLo[20]; // mean arrival time spread of the island 21 // - fTime[20][577] // mean of the arrival time 22 // - fTimeSpread[20]; // mean arrival time spread of the island 24 23 // 25 24 // … … 30 29 // MArrivalTimeCam 31 30 // 32 // 31 // Output Containers: 33 32 // MIslands 34 33 // … … 109 108 { 110 109 fIsl = (MIslands*)pList->FindCreateObj("MIslands", AddSerialNumber(fIslName)); 111 cout << "kk1" << endl;110 //cout << "kk1" << endl; 112 111 } 113 112 else 114 113 { 115 114 fIsl = (MIslands*)pList->FindCreateObj(AddSerialNumber("MIslands")); 116 cout << "kk2" << endl;115 //cout << "kk2" << endl; 117 116 } 118 117 if (!fIsl) … … 130 129 131 130 Int_t npix = 577; 131 132 132 Int_t sflag; 133 133 Int_t control; … … 148 148 149 149 150 MCerPhotPix *pix; 151 150 152 //loop over all pixels 151 for(Int_t idx=0 ; idx<npix ; idx++) 152 { 153 MCerPhotEvtIter Next(fEvt, kFALSE); 154 155 while ((pix=static_cast<MCerPhotPix*>(Next()))) 156 { 157 const Int_t idx = pix->GetPixId(); 158 153 159 const MGeomPix &gpix = (*fCam)[idx]; 154 160 const Int_t nnmax = gpix.GetNumNeighbors(); 155 156 if(idx<0 || idx==npix) 157 { 158 cout << "Pixel (software) index out of range [0-576]. Available number of pixels=" << npix << endl; 159 return 1; 160 } 161 162 161 163 162 if( fEvt->IsPixelUsed(idx)) 164 163 { … … 193 192 fIslNum = nvect; 194 193 195 194 196 195 // Repeated Chain Corrections 197 196 198 197 for(Int_t i = 1; i <= nvect; i++) 199 198 { … … 203 202 for(Int_t k = 0; k < npix; k++) 204 203 { 205 204 206 205 if (vect[i][k] == 1 && vect[j][k] == 1) 207 206 { … … 225 224 } 226 225 227 226 228 227 Int_t l = 1; 229 228 230 229 for(Int_t i = 1; i<= nvect ; i++) 231 230 { … … 239 238 } 240 239 } 241 240 242 241 243 242 //set the number of islands in one event … … 249 248 Float_t time[577]; 250 249 Float_t timeVariance[fIslNum]; 251 //Float_t timeHi[577], timeLo[577]; 252 //Float_t timeVarianceHi[fIslNum]; 253 //Float_t timeVarianceLo[fIslNum]; 254 250 255 251 //reset the "sets" functions 256 252 if (fIslNum <1) … … 262 258 fIsl->SetSigToNoise(i,-1); 263 259 fIsl->SetTimeSpread(i,-1); 264 // fIsl->SetTimeSpreadHi(i,-1); 265 // fIsl->SetTimeSpreadLo(i,-1); 266 260 267 261 for(Int_t idx = 0; idx<npix; idx++) 268 262 { 269 263 fIsl->SetIslId(idx, -1); 270 264 fIsl->SetArrivalTime(i, idx, -1 ); 271 // fIsl->SetArrivalTimeHiGain(i, idx, -1 );272 // fIsl->SetArrivalTimeLoGain(i, idx, -1);273 265 } 274 266 } 275 267 276 277 for(Int_t i = 1; i<=fIslNum ; i++)268 269 for(Int_t i = 1; i<=fIslNum ; i++) 278 270 { 279 271 Int_t n = 0; 280 272 Int_t ncore = 0; 281 282 Float_t MINhi = 10000; 283 Float_t MINlo = 10000; 284 Float_t MAXhi = 0; 285 Float_t MAXlo = 0; 273 286 274 Float_t MIN = 10000; 287 275 Float_t MAX = 0; 288 289 //cout << "Isl #" << i << endl;290 276 291 277 signal = 0; … … 293 279 fPixNum[i-1] = 0; 294 280 timeVariance[i-1] = 0; 295 // timeVarianceHi[i-1] = 0; 296 // timeVarianceLo[i-1] = 0; 297 281 298 282 for(Int_t idx=0 ; idx<npix ; idx++) 299 283 { 300 const MCerPhotPix &pix = (*fEvt)[idx]; 284 285 MCerPhotPix *pix = fEvt->GetPixById(idx); 301 286 const MPedestalPix &ped = (*fPed)[idx]; 302 287 const MArrivalTimePix &timepix = (*fTime)[idx]; 303 288 289 if (pix == NULL) break; 290 304 291 if (vect[i][idx]==1){ 305 292 306 293 fPixNum[i-1]++; 307 signal += pix .GetNumPhotons() * (fCam->GetPixRatio(idx));294 signal += pix->GetNumPhotons() * (fCam->GetPixRatio(idx)); 308 295 noise += pow(ped.GetPedestalRms(),2); 309 296 310 297 time[n] = timepix.IsLoGainUsed() ? timepix.GetArrivalTimeLoGain() : timepix.GetArrivalTimeHiGain(); 311 312 // timeHi[n] = timepix.GetArrivalTimeHiGain(); 313 // cout << "timeHi" << timeHi[n] << endl; 314 315 //timeLo[n] = timepix.GetArrivalTimeLoGain(); 316 //cout << "timeHi" << timeLo[n] << endl; 317 298 299 318 300 if (fEvt->IsPixelCore(idx)){ 319 301 320 /* if (timeHi[n] < MINhi)321 MINhi = timeHi[n];322 if (timeLo[n] < MINlo)323 MINlo = timeLo[n];324 325 if (timeHi[n] > MAXhi)326 MAXhi = timeHi[n];327 if (timeLo[n] > MAXlo)328 MAXlo = timeLo[n];329 330 */331 332 302 if (time[n] > MAX) 333 303 MAX = time[n]; … … 335 305 MIN = time[n]; 336 306 337 //control2[n] = 1;338 //timeVarianceHi[i-1] += timeHi[n];339 //timeVarianceLo[i-1] += timeLo[n];340 307 ncore++; 341 308 } 342 309 343 310 fIsl->SetIslId(idx, i-1); 344 311 fIsl->SetArrivalTime(i-1, idx, time[n]); 345 // fIsl->SetArrivalTimeHiGain(i-1, idx, timeHi[n]); 346 // fIsl->SetArrivalTimeLoGain(i-1, idx, timeLo[n]); 347 312 348 313 n++; 349 314 } … … 351 316 } 352 317 353 Float_t mean = timeVariance[i-1]/ncore; 354 // Float_t meanHi = timeVarianceHi[i-1]/ncore; 355 // Float_t meanLo = timeVarianceLo[i-1]/ncore; 356 318 // Float_t mean = timeVariance[i-1]/ncore; 319 357 320 timeVariance[i-1] = 0; 358 //timeVarianceHi[i-1] = 0; 359 //timeVarianceLo[i-1] = 0; 360 361 /* 362 //old 363 for (Int_t k = 0; k <n ; k++) 364 { 365 if (control2[k] == 1){ 366 367 timeVarianceHi[i-1] += pow(timeHi[k]- meanHi,2); 368 timeVarianceLo[i-1] += pow(timeLo[k]- meanLo,2); 369 } 370 } 371 timeVarianceHi[i-1] = sqrt(timeVarianceHi[i-1]/(ncore-1)); 372 timeVarianceLo[i-1] = sqrt(timeVarianceLo[i-1]/(ncore-1)); */ 373 374 //timeVarianceHi[i-1] = (MAXhi - MINhi)/ncore; 375 //timeVarianceLo[i-1] = (MAXlo - MINlo)/ncore; 376 321 377 322 timeVariance[i-1] = (MAX - MIN)/ncore; 378 323 timeVariance[i-1] = (MAX - MIN)/ncore; … … 383 328 fIsl->SetSigToNoise(i-1,fSigToNoise[i-1]); 384 329 fIsl->SetTimeSpread(i-1, timeVariance[i-1]); 385 //fIsl->SetTimeSpreadHi(i-1, timeVarianceHi[i-1]);386 //fIsl->SetTimeSpreadLo(i-1, timeVarianceLo[i-1]);387 388 //cout << " TimeHi Spread: " << timeVarianceHi[i-1] << endl;389 //cout << " # core pixels: " << ncore << endl;390 //cout << " # used pixels: " << n << endl;391 //cout << " SigToNoise: " << fSigToNoise[i-1] << endl << endl;392 330 393 331 } -
trunk/MagicSoft/Mars/mtemp/mifae/library/MIslands.cc
r3976 r4218 1 #include <fstream> 2 1 3 #include "MIslands.h" 2 4 3 5 #include "MCerPhotPix.h" 4 6 #include "MCerPhotEvt.h" 7 8 #include "MLog.h" 9 #include "MLogManip.h" 5 10 6 11 ClassImp(MIslands); … … 16 21 fName = name ? name : "MIslands"; 17 22 fTitle = title ? title : "Storage container for the island information of one event"; 18 23 19 24 } 20 25 … … 27 32 } 28 33 34 // -------------------------------------------------------------------------- 35 // 36 // Print the island parameters to *fLog 37 // 38 void MIslands::Print(Option_t *) const 39 { 40 *fLog << all; 41 *fLog << "Island Parameters (" << GetName() << ")" << endl; 42 *fLog << " - Island Number = " << fIslNum << endl; 43 for (Int_t i = 0; i< fIslNum ; i++) 44 { 45 *fLog << " Island Id " << i << endl; 46 *fLog << " + Pixel Number = " << fPixNum[i] << endl; 47 *fLog << " + SigToNoise = " << fSigToNoise[i] << endl; 48 } 49 } 29 50 51 -
trunk/MagicSoft/Mars/mtemp/mifae/library/MIslands.h
r3976 r4218 24 24 Float_t fSigToNoise[20]; // signal to noise of the island 25 25 Float_t fTime[20][577]; // mean of the arrival time 26 // Float_t fTimeHi[20][577]; // mean of the arrival time in the hi gain27 // Float_t fTimeLo[20][577]; // mean of the arrival time in the lo gain28 26 Float_t fTimeSpread[20]; // mean arrival time spread of the island 29 // Float_t fTimeSpreadHi[20]; // mean arrival time spread of the island30 // Float_t fTimeSpreadLo[20]; // mean arrival time spread of the island31 27 32 28 public: 33 29 MIslands(const char *name=NULL, const char *title=NULL); 34 30 ~MIslands(); 31 32 void Print(Option_t *opt=NULL) const; 35 33 36 34 Int_t GetIslNum() const { return fIslNum; } … … 39 37 Float_t GetSigToNoise(Int_t isl) { return fSigToNoise[isl]; } 40 38 Float_t GetArrivalTime(Int_t isl, Int_t idx) { return fTime[isl][idx]; } 41 //Float_t GetArrivalTimeHiGain(Int_t isl, Int_t idx) { return fTimeHi[isl][idx]; }42 //Float_t GetArrivalTimeLoGain(Int_t isl, Int_t idx) { return fTimeLo[isl][idx]; }43 39 Float_t GetTimeSpread(Int_t isl) { return fTimeSpread[isl];} 44 //Float_t GetTimeSpreadHi(Int_t isl) { return fTimeSpreadHi[isl];}45 //Float_t GetTimeSpreadLo(Int_t isl) { return fTimeSpreadLo[isl];}46 40 47 41 void SetIslNum(Int_t nisl) { fIslNum = nisl; } … … 50 44 void SetSigToNoise(Int_t isl, Float_t val) { fSigToNoise[isl] = val; } 51 45 void SetArrivalTime(Int_t isl, Int_t idx, Float_t val) { fTime[isl][idx] = val;} 52 // void SetArrivalTimeHiGain(Int_t isl, Int_t idx, Float_t val) { fTimeHi[isl][idx] = val;} 53 //void SetArrivalTimeLoGain(Int_t isl, Int_t idx, Float_t val) { fTimeLo[isl][idx] = val;} 46 54 47 void SetTimeSpread(Int_t isl, Float_t val) { fTimeSpread[isl] = val; } 55 //void SetTimeSpreadHi(Int_t isl, Float_t val) { fTimeSpreadHi[isl] = val; }56 //void SetTimeSpreadLo(Int_t isl, Float_t val) { fTimeSpreadLo[isl] = val; }57 48 58 49 ClassDef(MIslands, 1) // Storage Container for Island Parameters -
trunk/MagicSoft/Mars/mtemp/mifae/programs/makeHillas.cc
r4209 r4218 306 306 applycut.SetInverted(kTRUE); 307 307 MWriteRootFile* write=NULL; 308 M Display* disphillas=NULL;308 MHillasDisplay* disphillas=NULL; 309 309 310 310 write = new MWriteRootFile(outname,"RECREATE"); … … 325 325 326 326 if(display) 327 disphillas = new MHillasDisplay(&nphot,&geomcam); 327 { 328 disphillas = new MHillasDisplay(&nphot,&geomcam); 329 if (islflag == 1) 330 disphillas->SetIslandsName("MIslands1"); 331 if (islflag == 2) 332 disphillas->SetIslandsName("MIslands2"); 333 334 } 328 335 329 336 tlist4.AddToList(&read4);
Note:
See TracChangeset
for help on using the changeset viewer.