Changeset 4072 for trunk/MagicSoft/Mars/mtemp/mifae/programs
- Timestamp:
- 05/14/04 16:35:57 (21 years ago)
- Location:
- trunk/MagicSoft/Mars/mtemp/mifae/programs
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/mtemp/mifae/programs/srcPos.cc
r4056 r4072 29 29 #include "MArgs.h" 30 30 #include "MWriteRootFile.h" 31 #include "MTime.h" 31 32 32 33 using namespace std; … … 40 41 41 42 TString inputFile; 43 TString offFile; 42 44 TString outputFile; 45 TString offOutputFile; 43 46 ULong_t nmaxevents=999999999; 44 47 Float_t xsrcpos=0.; 45 48 Float_t ysrcpos=0.; 46 49 Double_t mjdpos=53050; 47 Bool_t kRotate= 1;48 Bool_t kSrcPolicy=k TRUE;50 Bool_t kRotate=0; 51 Bool_t kSrcPolicy=kFALSE; 49 52 Double_t fRA= -1.; 50 53 Double_t fDEC= -1.; 54 TString srcFile; 51 55 52 56 //----------------------------------------------------------------------------- … … 55 59 56 60 const TString defaultcard="srcpos.datacard"; 57 58 const Float_t alphamin = 0.; // minimum value in alpha (degrees)59 const Float_t alphamax = 90.; // maximum value in alpha (degrees)60 61 const Float_t conver = 189./0.6; // conversion factor degrees to mm 61 62 … … 147 148 tlist.PrintStatistics(); 148 149 150 151 // do off-data if input file was specified 152 if(!offFile.Length()) 153 return; 154 155 MReadTree read2("Parameters", offFile); 156 read2.DisableAutoScheme(); 157 tlist.AddToListBefore(&read2, &read, "All"); 158 tlist.RemoveFromList(&read); 159 160 MWriteRootFile write2(offOutputFile,"RECREATE"); 161 write2.AddContainer("MHillas" , "Parameters"); 162 write2.AddContainer("MHillasSrc" , "Parameters"); 163 write2.AddContainer("MHillasExt" , "Parameters"); 164 write2.AddContainer("MNewImagePar" , "Parameters"); 165 write2.AddContainer("MRawEvtHeader" , "Parameters"); 166 write2.AddContainer("MRawRunHeader" , "Parameters"); 167 write2.AddContainer("MConcentration" , "Parameters"); 168 write2.AddContainer("MSrcPosCam" , "Parameters"); 169 tlist.AddToListBefore(&write2,&write,"All"); 170 tlist.RemoveFromList(&write); 171 172 srcrotate.SetMode(MSrcPlace::kOff); 173 174 if (!evtloop.Eventloop(nmaxevents)) 175 return; 176 177 tlist.PrintStatistics(); 178 149 179 } 150 180 //----------------------------------------------------------------------- … … 182 212 } 183 213 214 // off-data file name 215 if(strcmp(word.Data(),"OFFFILES")==0) 216 { 217 if(offFile.Length()) 218 cout << "readDataCards Warning: overriding off-data file name" << endl; 219 ifun >> offFile; 220 } 221 184 222 // output file name 185 223 if(strcmp(word.Data(),"OUTFILE")==0) … … 190 228 } 191 229 230 // output file name (off data) 231 if(strcmp(word.Data(),"OFFOUTFILE")==0) 232 { 233 if(offOutputFile.Length()) 234 cout << "readDataCards Warning: overriding output file name for off data" << endl; 235 ifun >> offOutputFile; 236 } 237 238 // source position input file 239 if(strcmp(word.Data(),"SRCFILE")==0) 240 { 241 if(srcFile.Length()) 242 cout << "readDataCards Warning: overriding source-position file name" << endl; 243 ifun >> srcFile; 244 } 245 192 246 // source position 193 247 if(strcmp(word.Data(),"SRCPOS")==0) … … 227 281 } 228 282 283 if(offFile.Length() && !offOutputFile.Length()) 284 { 285 cout << "No output file name specified for off data" << endl; 286 return kFALSE; 287 } 288 229 289 if(xsrcpos==0 && ysrcpos==0) 230 290 { … … 232 292 return kFALSE; 233 293 } 294 295 MTime thetime(mjdpos); 234 296 235 297 // Dump read values … … 239 301 cout << "Maximum number of input events: " << nmaxevents << endl; 240 302 cout << "Input file name(s): " << inputFile << endl; 303 if(offFile.Length()) 304 cout << "Input file name(s) for off data: " << offFile << endl; 241 305 cout << "Output file name: " << outputFile << endl; 242 cout << "Source position (degrees) X=" << xsrcpos << ", Y="<<ysrcpos; 243 if(kSrcPolicy) 244 cout << " (RELATIVE TO INITIAL SOURCE POSITION)" << endl; 306 if(offFile.Length()) 307 cout << "Output file name for off data: " << offOutputFile << endl; 308 if(srcFile.Length()) 309 cout << "Reading source position from file " << srcFile << endl; 245 310 else 246 cout << " (ABSOLUTE POSITION IN THE CAMERA)" << endl; 247 cout << "De-rotation flag " << kRotate << endl; 248 cout << "Source celestial coordiantes (rad): RA = " << fRA << ", DEC = " << fDEC << endl; 311 { 312 cout << "Source position (degrees) X=" << xsrcpos << ", Y="<<ysrcpos; 313 if(kSrcPolicy) 314 cout << " (RELATIVE TO INITIAL SOURCE POSITION)"; 315 else 316 cout << " (ABSOLUTE POSITION IN THE CAMERA)"; 317 cout << ", at " << thetime.GetSqlDateTime() << endl; 318 cout << "De-rotation flag " << kRotate << endl; 319 cout << "Source celestial coordiantes (rad): RA = " << fRA << ", DEC = " << fDEC << endl; 320 } 249 321 cout << "***********" << endl << endl; 250 322 -
trunk/MagicSoft/Mars/mtemp/mifae/programs/srcpos.datacard
r4056 r4072 1 1 2 2 // Maximun number of on and off events to be processed) 3 NEVENTS 200003 NEVENTS 99999999 4 4 5 5 // Input file name pattern 6 INPUTFILES 6 INPUTFILES /mnt/users/jrico/magic/mars/Mars_Standard02/mtemp/mifae/hillas/mrk20040215OnNoCalB.root 7 7 8 // output file name 8 // Specify optionally the name of OFF-data files you want to apply the same source position distribution to 9 OFFFILES /mnt/users/jrico/magic/mars/Mars_Standard02/mtemp/mifae/hillas/mrk20040215OffNoCal*.root 10 11 // output file name (on data) 9 12 OUTFILE ./srcPosPrueba.root 10 13 11 // X and Y position of the source in degrees for a MJ date (days) -important only in case of rotation 14 // output file name (off data) 15 OFFOUTFILE ./srcPosOffPrueba.root 16 17 // X and Y position of the source (degrees) for a MJ date (days) -important only in case of rotation 12 18 SRCPOS 0.21 0.176 53050.0773 13 19 … … 24 30 SRCCOORDS 2.899 0.667 // (Mrk 421) 25 31 32 33 // File containing source position as a function of run number (overrides SRCPOS, SRCABS, ROTFLAG and SRCCOORDS values) 34 // SRCFILE ./20040215_Mrk421.B.pos 35 36 37
Note:
See TracChangeset
for help on using the changeset viewer.