Changeset 4094 for trunk/MagicSoft/Mars/mtemp/mifae/programs
- Timestamp:
- 05/18/04 10:16:45 (21 years ago)
- Location:
- trunk/MagicSoft/Mars/mtemp/mifae/programs
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/mtemp/mifae/programs/falseSource.cc
r4045 r4094 16 16 17 17 #include "TString.h" 18 #include "TH 1F.h"18 #include "TH2F.h" 19 19 #include "TFile.h" 20 20 21 21 #include "MHillasSrcCalc.h" 22 22 #include "MSrcPosCam.h" 23 #include "MSrcTranslate.h" 23 24 #include "MHillasSrc.h" 24 25 #include "MSrcRotate.h" … … 43 44 TString offFile; 44 45 TString outputFile; 45 Bool_t kRotate=1; 46 Bool_t kRotate=1; 47 Bool_t kSrcPolicy=kFALSE; 46 48 Double_t fRA= -1.; 47 49 Double_t fDEC= -1.; … … 73 75 const Float_t alphamax = 90.; // maximum value in alpha (degrees) 74 76 const Float_t conver = 189./0.6; // conversion factor degrees to mm 77 const Float_t srclimit = field*conver; 78 const Float_t srcstep = 3.; 79 const Int_t nsrcbin = (Int_t) (srclimit/srcstep); 75 80 76 81 //----------------------------------------------------------------------------- … … 131 136 132 137 // create the histograms (empty) 133 TH1F *hOnAlpha[binning][binning]; 134 TH1F *hOffAlpha[binning][binning]; 138 TH1F* hOnAlpha[binning][binning]; 139 TH1F* hOffAlpha[binning][binning]; 140 TH2F* hOnSrcPos[binning]; 141 TH2F* hOffSrcPos[binning]; 142 135 143 for(Int_t i = -ival; i <= ival ; i++){ 136 144 for(Int_t j = -ival; j <= ival ; j++){ … … 144 152 hOffAlpha[i+ival][j+ival] = new TH1F(name, title, nbin, alphamin, alphamax); 145 153 154 if(j==0) 155 { 156 sprintf(name,"hOnSrcPos[%d]", i); 157 sprintf(title,"Source position (On data) (%d)", i); 158 hOnSrcPos[i+ival] = new TH2F(name, title, nsrcbin, -srclimit, srclimit, nsrcbin, -srclimit, srclimit); 159 160 sprintf(name,"hOffSrcPos[%d]", i); 161 sprintf(title,"Source position (Off data) (%d)", i); 162 hOffSrcPos[i+ival] = new TH2F(name, title, nsrcbin, -srclimit, srclimit, nsrcbin, -srclimit, srclimit); 163 } 146 164 } 147 165 } … … 154 172 155 173 // source dependent hillas containers/tasks 156 MHillasSrcCalc* csrc1[binning][binning];157 174 MSrcPosCam* source[binning][binning]; 158 175 MHillasSrc* hillasSrc[binning][binning]; 176 MSrcTranslate* srctranslate[binning][binning]; 159 177 MSrcRotate* srcrotate[binning][binning]; 178 MHillasSrcCalc* csrc1[binning][binning]; 160 179 161 180 // normal containers/classes … … 171 190 tlist.AddToList(&read); 172 191 173 Int_t k,l;174 192 char sourceName[100]; 175 193 char hillasSrcName[100]; 194 char translateName[100]; 195 char rotateName[100]; 176 196 177 197 // create the tasks/containers for the different source positions … … 186 206 if (i<0 && j<0) 187 207 { 188 k = -i;189 l = -j;208 Int_t k = -i; 209 Int_t l = -j; 190 210 sprintf(sourceName, "MSrcPosCam_Min%dMin%d", k, l); 191 211 sprintf(hillasSrcName, "MHillasSrc_Min%dMin%d", k, l); 212 sprintf(translateName, "MSrcTranslate_Min%dMin%d", k, l); 213 sprintf(rotateName, "MSrcRotate_Min%dMin%d", k, l); 192 214 } 193 215 194 216 if (i<0 && j>=0) 195 217 { 196 k = -i;218 Int_t k = -i; 197 219 sprintf(sourceName, "MSrcPosCam_Min%d%d", k, j); 198 220 sprintf(hillasSrcName, "MHillasSrc_Min%d%d", k, j); 221 sprintf(translateName, "MSrcTranslate_Min%d%d", k, j); 222 sprintf(rotateName, "MSrcRotate_Min%d%d", k, j); 199 223 } 200 224 201 225 if (i>=0 && j<0) 202 226 { 203 l = -j;227 Int_t l = -j; 204 228 sprintf(sourceName, "MSrcPosCam_%dMin%d", i, l); 205 229 sprintf(hillasSrcName, "MHillasSrc_%dMin%d", i, l); 230 sprintf(translateName, "MSrcTranslate_%dMin%d", i, l); 231 sprintf(rotateName, "MSrcRotate_%dMin%d", i, l); 206 232 } 207 233 … … 210 236 sprintf(sourceName, "MSrcPosCam_%d%d", i, j); 211 237 sprintf(hillasSrcName, "MHillasSrc_%d%d", i, j); 238 sprintf(translateName, "MSrcTranslate_%d%d", i, j); 239 sprintf(rotateName, "MSrcRotate_%d%d", i, j); 212 240 } 213 241 214 242 // include containers in parameter list 215 243 source[i+ival][j+ival] = new MSrcPosCam(sourceName); 216 source[i+ival][j+ival]->SetXY(xpos, ypos);217 244 plist.AddToList(source[i+ival][j+ival]); 218 source[i+ival][j+ival]->Print();219 245 220 246 hillasSrc[i+ival][j+ival] = new MHillasSrc(hillasSrcName); … … 222 248 223 249 // define the different tasks and include them in the task list 224 if(kRotate) 250 srctranslate[i+ival][j+ival] = new MSrcTranslate("MSrcPosCam",sourceName,"MDCA",translateName); 251 srctranslate[i+ival][j+ival]->SetTranslation(xpos,ypos); 252 srctranslate[i+ival][j+ival]->SetRelativeTranslation(kSrcPolicy); 253 srctranslate[i+ival][j+ival]->SetInternalHistoBinSize(5.); 254 srctranslate[i+ival][j+ival]->SetMode(MSrcPlace::kOn); 255 256 tlist.AddToList(srctranslate[i+ival][j+ival]); 257 258 if(kRotate && !kSrcPolicy) 225 259 { 226 srcrotate[i+ival][j+ival] = new MSrcRotate(sourceName );260 srcrotate[i+ival][j+ival] = new MSrcRotate(sourceName,sourceName,"MDCA",rotateName); 227 261 srcrotate[i+ival][j+ival]->SetRAandDEC(fRA,fDEC); 262 263 srctranslate[i+ival][j+ival]->SetCreateHisto(kFALSE); 264 srcrotate[i+ival][j+ival]->SetMode(MSrcPlace::kOn); 265 srcrotate[i+ival][j+ival]->SetInternalHistoBinSize(5.); 266 228 267 tlist.AddToList(srcrotate[i+ival][j+ival]); 229 268 } 269 else 270 srcrotate[i+ival][j+ival] = NULL; 271 230 272 231 273 TString HilName = "MHillas"; … … 266 308 hOnAlpha[i+ival][j+ival]->Fill(TMath::Abs(alpha)); 267 309 } 310 311 // fill source position histo 312 if(j==0) 313 hOnSrcPos[i+ival]->Fill(source[i+ival][j+ival]->GetX(),source[i+ival][j+ival]->GetY()); 268 314 } 269 315 if(++nread>nmaxevents) break; … … 278 324 FILL OFF-DATA HISTOS 279 325 *******************************************************************/ 326 for(Int_t i=-ival;i<=ival;i++) 327 for(Int_t j=-ival;j<=ival;j++) 328 { 329 if(srcrotate[i+ival][j+ival]) 330 srcrotate[i+ival][j+ival]->SetMode(MSrcPlace::kOff); 331 srctranslate[i+ival][j+ival]->SetMode(MSrcPlace::kOff); 332 } 333 280 334 281 335 MReadTree read2("Parameters", offFile); … … 306 360 hOffAlpha[i+ival][j+ival]->Fill(TMath::Abs(alpha)); 307 361 } 362 363 // fill source position histo 364 if(j==0) 365 hOffSrcPos[i+ival]->Fill(source[i+ival][j+ival]->GetX(),source[i+ival][j+ival]->GetY()); 308 366 } 309 367 if(++nread>nmaxevents) break; … … 319 377 hOnAlpha[i+ival][j+ival]->Write(); 320 378 hOffAlpha[i+ival][j+ival]->Write(); 379 if(j==0) 380 { 381 hOnSrcPos[i+ival]->Write(); 382 hOffSrcPos[i+ival]->Write(); 383 } 321 384 } 322 385 } … … 324 387 f->Close(); 325 388 389 for(Int_t i=-ival;i<=ival;i++) 390 for(Int_t j=-ival;j<=ival;j++) 391 { 392 if(srcrotate[i+ival][j+ival]) 393 delete srcrotate[i+ival][j+ival]; 394 delete srctranslate[i+ival][j+ival]; 395 delete source[i+ival][j+ival]; 396 delete hillasSrc[i+ival][j+ival]; 397 delete csrc1[i+ival][j+ival]; 398 } 326 399 } 327 400 //----------------------------------------------------------------------- … … 379 452 ifun >> kRotate; 380 453 454 // source movement policy flag 455 if(strcmp(word.Data(),"SRCABS")==0) 456 ifun >> kSrcPolicy; 457 458 381 459 // source celestial coordinates 382 460 if(strcmp(word.Data(),"SRCCOORDS")==0) … … 394 472 ifun >> binning; 395 473 396 397 474 // Number of bins in alpha plots 398 475 if(strcmp(word.Data(),"NBIN")==0) 399 476 ifun >> nbin; 400 401 402 403 477 404 478 // size cut … … 461 535 cout << "Off-data file name(s): " << offFile << endl; 462 536 cout << "Output file name: " << outputFile << endl; 463 cout << "De-rotation flag " << kRotate << endl; 464 cout << "Source celestial coordiantes (rad): RA = " << fRA << ", DEC = " << fDEC << endl; 537 if(kSrcPolicy) 538 cout << "Source position displaced with respect to the original existing one (no rotation applied)" << endl; 539 else 540 { 541 cout << "De-rotation flag " << kRotate << endl; 542 cout << "Source celestial coordiantes (rad): RA = " << fRA << ", DEC = " << fDEC << endl; 543 } 465 544 cout << "Field width (degrees): " << field << endl; 466 545 cout << "Field binning: " << binning << endl; -
trunk/MagicSoft/Mars/mtemp/mifae/programs/falsesource.datacard
r3973 r4094 4 4 5 5 // On-data file name pattern 6 ONFILES /mnt/users/jrico/magic/mars/Mars_Standard01/hillasCrab/crab20040215On*.root6 ONFILES ./srcPosPrueba.root 7 7 8 8 // Off-data file name pattern 9 OFFFILES /mnt/users/jrico/magic/mars/Mars_Standard01/hillasCrab/crab20040215Off*.root9 OFFFILES ./srcPosOffPrueba.root 10 10 11 11 // output file name 12 OUTFILE ./rotateprueba .root12 OUTFILE ./rotateprueba2.root 13 13 14 14 // rotation flag: … … 19 19 // source coordinates (RA DEC in rads) 20 20 SRCCOORDS 1.46 0.384 21 22 // Flag to determine whether source position is absolute (0) or relative to previous position (1) 23 // In case SRCABS=1, no rotation is carried out 24 SRCABS 1 21 25 22 26 // Width of examined field (degrees) -
trunk/MagicSoft/Mars/mtemp/mifae/programs/srcPos.cc
r4084 r4094 128 128 srctranslate.SetTranslation(xpos,ypos); 129 129 srctranslate.SetRelativeTranslation(kSrcPolicy); 130 srctranslate.SetCreateHisto(kFALSE); 130 131 srcrotate.SetRAandDECandRefMJD(fRA,fDEC,mjdpos); 131 132 srcrotate.SetMode(MSrcPlace::kOn); … … 164 165 165 166 tlist.PrintStatistics(); 166 167 167 168 168 // do off-data if input file was specified … … 196 196 197 197 tlist.PrintStatistics(); 198 199 198 } 200 199 //----------------------------------------------------------------------- -
trunk/MagicSoft/Mars/mtemp/mifae/programs/srcpos.datacard
r4087 r4094 1 1 2 2 // Maximun number of on and off events to be processed) 3 NEVENTS 200003 NEVENTS 9999999 4 4 5 // Input file name pattern 5 // Input file name pattern (wildcards allowed) 6 6 INPUTFILES /mnt/users/jrico/magic/mars/Mars_Standard02/mtemp/mifae/hillas/mrk20040215OnNoCalB.root 7 7
Note:
See TracChangeset
for help on using the changeset viewer.