Changeset 2377 for trunk/MagicSoft/Mars
- Timestamp:
- 10/04/03 12:47:13 (21 years ago)
- Location:
- trunk/MagicSoft/Mars
- Files:
-
- 42 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/macros/MagicHillas.C
r2359 r2377 41 41 42 42 // 43 // The geometry container must be created by yourself to make sure44 // that you don't choos a wrong geometry by chance45 //46 MGeomCamMagic geomcam;47 plist.AddToList(&geomcam);48 49 //50 43 // Use this if you want to change the binning of one of 51 44 // the histograms. You can use: … … 86 79 MReadMarsFile read("Events", filename); 87 80 read.DisableAutoScheme(); 81 82 MGeomApply geomapl; 88 83 89 84 MMcPedestalCopy pcopy; … … 127 122 128 123 tlist.AddToList(&read); 124 tlist.AddToList(&geomapl); 129 125 tlist.AddToList(&pcopy); 130 126 tlist.AddToList(&pnsb); -
trunk/MagicSoft/Mars/macros/pedestalvstime.C
r2252 r2377 39 39 // 40 40 41 MGeomCamMagic geom;42 plist.AddToList(&geom);43 44 41 // First Task: Read file with image parameters 45 42 // (created with the star.C macro) … … 48 45 read.DisableAutoScheme(); 49 46 47 MGeomApply geomapl; 48 50 49 MCerPhotAnal2 ncalc; 51 50 52 51 tlist.AddToList(&read); 52 tlist.AddToList(&geomapl); 53 53 tlist.AddToList(&ncalc); 54 54 -
trunk/MagicSoft/Mars/macros/pixfirerate.C
r2251 r2377 61 61 plist.AddToList(&tlist); 62 62 63 // The geometry container must be created by yourself to make sure64 // that you don't choose a wrong geometry by mistake65 //66 MGeomCamMagic geomcam;67 plist.AddToList(&geomcam);68 69 63 // 70 64 // Now setup the tasks and tasklist: … … 75 69 read.AddFile(filename); 76 70 tlist.AddToList(&read); 71 72 MGeomApply geomapl; 73 tlist.AddToList(&geomapl); 77 74 78 75 Double_t threshold[] = { 10, 20, 100, 200, -1 }; -
trunk/MagicSoft/Mars/macros/pixsatrate.C
r2265 r2377 61 61 plist.AddToList(&tlist); 62 62 63 // The geometry container must be created by yourself to make sure64 // that you don't choose a wrong geometry by mistake65 //66 MGeomCamMagic geomcam;67 plist.AddToList(&geomcam);68 69 63 // 70 64 // Now setup the tasks and tasklist: … … 75 69 read.AddFile(filename); 76 70 tlist.AddToList(&read); 71 72 MGeomApply geomapl; 73 tlist.AddToList(&geomapl); 77 74 78 75 MHTriggerLvl0 trighi(254, "SaturationHi", "Saturation Rate of Hi Gains"); -
trunk/MagicSoft/Mars/macros/plot.C
r1966 r2377 23 23 ! 24 24 \* ======================================================================== */ 25 #include <MH.h> 25 26 26 // ------------------------------------------------------------------------- 27 27 // -
trunk/MagicSoft/Mars/macros/readCT1.C
r2220 r2377 62 62 63 63 MCT1ReadAscii read(fname); 64 MGeomApply geomapl; 64 65 MClone clone("MCerPhotEvt"); 65 66 MImgCleanStd clean; -
trunk/MagicSoft/Mars/macros/readMagic.C
r2221 r2377 50 50 MParList plist; 51 51 52 MGeomCamMagic geomcam;53 52 MHillas hillas; 54 53 MHillasExt hillasext; … … 56 55 MTaskList tlist; 57 56 58 plist.AddToList(&geomcam);59 57 plist.AddToList(&hillas); 60 58 plist.AddToList(&hillasext); … … 65 63 read.DisableAutoScheme(); 66 64 65 MGeomApply geomapl; 67 66 MPrint print1("MMcEvt"); 68 67 MPrint print2("MRawEvtHeader"); … … 80 79 81 80 tlist.AddToList(&read); 81 tlist.AddToList(&geomapl); 82 82 tlist.AddToList(&print1); 83 83 tlist.AddToList(&print2); -
trunk/MagicSoft/Mars/macros/starplot.C
r1633 r2377 42 42 43 43 // 44 // The geometry container must be created by yourself to make sure45 // that you don't choos a wrong geometry by chance46 //47 MGeomCamMagic geomcam;48 plist.AddToList(&geomcam);49 50 //51 44 // Use this if you want to change the binning of one of 52 45 // the histograms. You can use: … … 79 72 read.DisableAutoScheme(); 80 73 74 MGeomApply geomapl; 75 81 76 MFillH hfill1("MHHillas", "MHillas"); 82 77 MFillH hfill2("MHHillasExt"); … … 86 81 87 82 tlist.AddToList(&read); 83 tlist.AddToList(&geomapl); 88 84 tlist.AddToList(&hfill1); 89 85 tlist.AddToList(&hfill2); -
trunk/MagicSoft/Mars/macros/status.C
r2274 r2377 57 57 plist.AddToList(&tlist); 58 58 59 //60 // The geometry container must be created by yourself to make sure61 // that you don't choose a wrong geometry by mistake62 //63 MGeomCamMagic geomcam;64 plist.AddToList(&geomcam);65 66 59 /* 67 60 MSrcPosCam src; … … 79 72 // ------------- user change ----------------- 80 73 read.AddFile(fname); 74 75 MGeomApply geomapl; 81 76 82 77 MMcPedestalCopy pcopy; … … 117 112 118 113 tlist.AddToList(&read); 114 tlist.AddToList(&geomapl); 119 115 tlist.AddToList(&pcopy); 120 116 tlist.AddToList(&pnsb); -
trunk/MagicSoft/Mars/macros/sumevents.C
r2274 r2377 39 39 // 40 40 41 MGeomCamMagic geom;42 plist.AddToList(&geom);43 44 41 // First Task: Read file with image parameters 45 42 // (created with the star.C macro) … … 48 45 read.DisableAutoScheme(); 49 46 47 MGeomApply geomapl; 50 48 MCerPhotAnal2 ncalc; 51 49 52 50 tlist.AddToList(&read); 51 tlist.AddToList(&geomapl); 53 52 tlist.AddToList(&ncalc); 54 53 -
trunk/MagicSoft/Mars/macros/sumeventserr.C
r2274 r2377 39 39 // 40 40 41 MGeomCamMagic geom;42 plist.AddToList(&geom);43 44 41 // First Task: Read file with image parameters 45 42 // (created with the star.C macro) … … 51 48 //MCerPhotCalc ncalc; 52 49 //MCerPhotAnal ncalc; 50 MGeomApply geomapl; 53 51 MCerPhotAnal2 ncalc; 54 52 55 53 tlist.AddToList(&read); 54 tlist.AddToList(&geomapl); 56 55 tlist.AddToList(&ncalc); 57 56 -
trunk/MagicSoft/Mars/macros/sumeventsrms.C
r2274 r2377 39 39 // 40 40 41 MGeomCamMagic geom;42 plist.AddToList(&geom);43 44 41 // First Task: Read file with image parameters 45 42 // (created with the star.C macro) … … 48 45 read.DisableAutoScheme(); 49 46 47 MGeomApply geomapl; 50 48 MPedestalSum ncalc; 51 49 //MCerPhotCalc ncalc; … … 54 52 55 53 tlist.AddToList(&read); 54 tlist.AddToList(&geomapl); 56 55 tlist.AddToList(&ncalc); 57 56 -
trunk/MagicSoft/Mars/macros/sumpedestalrms.C
r2274 r2377 39 39 // 40 40 41 MGeomCamMagic geom;42 plist.AddToList(&geom);43 44 41 // First Task: Read file with image parameters 45 42 // (created with the star.C macro) … … 48 45 read.DisableAutoScheme(); 49 46 47 MGeomApply geomapl; 50 48 MCerPhotAnal2 ncalc; 51 49 52 50 tlist.AddToList(&read); 51 tlist.AddToList(&geomapl); 53 52 tlist.AddToList(&ncalc); 54 53 -
trunk/MagicSoft/Mars/macros/sumpedestals.C
r2274 r2377 39 39 // 40 40 41 MGeomCamMagic geom;42 plist.AddToList(&geom);43 44 41 // First Task: Read file with image parameters 45 42 // (created with the star.C macro) … … 48 45 read.DisableAutoScheme(); 49 46 47 MGeomApply geomapl; 50 48 MCerPhotAnal2 ncalc; 51 49 52 50 tlist.AddToList(&read); 51 tlist.AddToList(&geomapl); 53 52 tlist.AddToList(&ncalc); 54 53 -
trunk/MagicSoft/Mars/macros/threshold.C
r1666 r2377 16 16 ! 17 17 ! 18 ! Author(s): Thomas Bretz 12/2000 (tbretz@uni-sw.gwdg.de)18 ! Author(s): Thomas Bretz, 12/2000 <mailto:tbretz@astro.uni-wuerzburg.de> 19 19 ! 20 ! Copyright: MAGIC Software Development, 2000-200 120 ! Copyright: MAGIC Software Development, 2000-2003 21 21 ! 22 22 ! -
trunk/MagicSoft/Mars/macros/trigrate.C
r1800 r2377 16 16 ! 17 17 ! 18 ! Author(s): Thomas Bretz 12/2000 (tbretz@uni-sw.gwdg.de)18 ! Author(s): Thomas Bretz, 12/2000 <mailto:tbretz@astro.uni-wuerzburg.de> 19 19 ! 20 20 ! Copyright: MAGIC Software Development, 2000-2001 21 21 ! 22 ! Modified 4/7/2002, Abelardo Moralejo:23 ! Added one optional input parameter: a camera .root file containing24 ! pure NSB events. One such file is generated running the camera over an25 ! "empty" reflector file, with the NSB option on, and asking the camera26 ! program (see camera program manual) to do the simulation even if no27 ! photoelectron from the shower arrives at the camera. One also needs to28 ! write to the output file all the events, both triggered and untriggered29 ! (see again camera manual). These nsb camera files must contain the same30 ! trigger conditions as the proton file.31 !32 ! If no nsb file is supplied, the macro will assume no triggers from33 ! pure NSB fluctuations.34 !35 22 \* ======================================================================== */ 36 23 37 24 /* 25 ! Modified 4/7/2002, Abelardo Moralejo: 26 ! Added one optional input parameter: a camera .root file containing 27 ! pure NSB events. One such file is generated running the camera over an 28 ! "empty" reflector file, with the NSB option on, and asking the camera 29 ! program (see camera program manual) to do the simulation even if no 30 ! photoelectron from the shower arrives at the camera. One also needs to 31 ! write to the output file all the events, both triggered and untriggered 32 ! (see again camera manual). These nsb camera files must contain the same 33 ! trigger conditions as the proton file. 34 ! 35 ! If no nsb file is supplied, the macro will assume no triggers from 36 ! pure NSB fluctuations. 37 */ 38 38 39 39 Float_t GetNSBEvents(TString name, Float_t *BgR, int dim) … … 138 138 if (dim < 0) 139 139 ((MHMcRate*)(hists[0]))->SetTriggerCondNum((Short_t)(-dim)); 140 elseif (dim > 0)140 if (dim > 0) 141 141 for (Short_t i = from ; i <= to; i++) 142 142 ((MHMcRate*)(hists[i-1]))->SetTriggerCondNum(i); -
trunk/MagicSoft/Mars/manalysis/AnalysisLinkDef.h
r2300 r2377 19 19 #pragma link C++ class MMcPedestalCopy+; 20 20 #pragma link C++ class MMcPedestalNSBAdd+; 21 #pragma link C++ class MGeomApply+; 21 22 22 23 #pragma link C++ class MHadronness+; -
trunk/MagicSoft/Mars/manalysis/MBlindPixelCalc.cc
r2298 r2377 303 303 fPixels->Clear(); 304 304 305 if (!fGeomCam->InheritsFrom("MGeomCamMagic")) 306 { 307 *fLog << warn << "MBlindPixelCalc::ReInit: Warning - Starfield only implemented for Magic standard Camera... no action." << endl; 308 return kTRUE; 309 } 310 305 311 // 306 312 // Set as blind some particular pixels because of a particular -
trunk/MagicSoft/Mars/manalysis/MBlindPixels.h
r1967 r2377 21 21 void AdoptPixels(Char_t pixels[577]) { fPixels.Adopt(577, pixels); } 22 22 23 void AdoptPixels(const TArrayC &pixels) { fPixels = pixels; } 24 23 25 void Clear(Option_t *o="") { fPixels.Reset(); } 24 26 25 27 Bool_t IsBlind(UShort_t id) const { return fPixels.GetSize() && ((TArrayC)fPixels)[id]; } 28 29 void InitSize(UShort_t i) { fPixels.Set(i); } 26 30 27 31 ClassDef(MBlindPixels, 1) // container to store blind pixels -
trunk/MagicSoft/Mars/manalysis/MCerPhotCalc.cc
r2350 r2377 48 48 #include "MLogManip.h" 49 49 50 #include "MGeomCam.h" 50 51 #include "MMcRunHeader.hxx" 51 52 … … 174 175 void MCerPhotCalc::ScalePedestals() 175 176 { 176 Int_t n = 577; //FIXME: fPedestals->GetNumPixel();177 const Int_t n = fPedestals->GetSize(); 177 178 178 179 for (int idx=0; idx<n; idx++) … … 186 187 const Double_t offset = fEnableFix ? ped.GetPedestal()-0.5 : ped.GetPedestal(); 187 188 188 ped.Set(offset*fSumWeights, 189 ped.GetPedestalRms()*fSumQuadWeights); 189 ped.Set(offset*fSumWeights, ped.GetPedestalRms()*fSumQuadWeights); 190 190 } 191 191 … … 205 205 // ScalePedestals(); 206 206 207 const Int_t n = fWeight.GetSize(); 208 207 209 MRawEvtPixelIter pixel(fRawEvt); 208 210 209 Int_t SaturatedPixels = 0;211 Int_t saturatedpixels = 0; 210 212 211 213 while (pixel.Next()) 212 214 { 213 215 const UInt_t idx = pixel.GetPixelId(); 214 MPedestalPix &ped = (*fPedestals)[idx];215 216 216 // 217 217 // sanity check (old MC files sometimes have pixids>577) … … 219 219 if (!fPedestals->CheckBounds(idx)) 220 220 { 221 *fLog << inf << "Pixel Index larger than camera... skipping event." << endl;221 *fLog << inf << "Pixel Index out of MPedestalCam bounds... skipping event." << endl; 222 222 return kCONTINUE; 223 } 223 } 224 225 MPedestalPix &ped = (*fPedestals)[idx]; 224 226 225 227 // … … 230 232 Int_t i; 231 233 Double_t nphot = 0; 232 for (i=0; i< fWeight.GetSize(); i++)234 for (i=0; i<n; i++) 233 235 { 234 236 if (ptr[i]==0xff) … … 237 239 } 238 240 239 Bool_t SaturatedLG= kFALSE;240 241 if (i< fWeight.GetSize())241 Bool_t saturatedlg = kFALSE; 242 243 if (i<n) 242 244 { 243 245 nphot = 0; … … 250 252 } 251 253 252 for (i=0; i< fWeight.GetSize(); i++)254 for (i=0; i<n; i++) 253 255 { 254 255 SaturatedLG= kTRUE;256 257 256 if (ptr[i]==0xff) 257 saturatedlg = kTRUE; 258 259 nphot += ptr[i]*fWeight[i]; 258 260 } 259 261 … … 266 268 fCerPhotEvt->AddPixel(idx, nphot, 0); 267 269 268 if (SaturatedLG) 269 SaturatedPixels ++; 270 } 271 272 switch(SaturatedPixels) 273 { 274 case 0: 275 break; 276 case 1: 277 *fLog << warn << "WARNING: 1 pixel had saturating low gains..." << endl; 278 break; 279 default: 280 *fLog << warn << "WARNING: " << SaturatedPixels << " pixels had saturating low gains..." << endl; 281 break; 282 } 283 270 if (saturatedlg) 271 saturatedpixels++; 272 } 273 274 if (saturatedpixels>0) 275 *fLog << warn << "WARNING: " << saturatedpixels << " pixel(s) had saturating low gains..." << endl; 284 276 285 277 fCerPhotEvt->FixSize(); -
trunk/MagicSoft/Mars/manalysis/MMcPedestalCopy.cc
r2237 r2377 126 126 return kFALSE; 127 127 128 const int num = fMcPed->GetNumPixel(); 129 130 fPedCam->InitSize(num); 128 const int num = fPedCam->GetSize(); 131 129 132 130 for (int i=0; i<num; i++) -
trunk/MagicSoft/Mars/manalysis/MMcPedestalNSBAdd.cc
r2237 r2377 207 207 return kFALSE; 208 208 209 const int num = fFadc->GetNumPixel(); 210 211 fPedCam->InitSize(num); 209 const int num = fPedCam->GetSize(); 212 210 213 211 for (int i=0; i<num; i++) -
trunk/MagicSoft/Mars/manalysis/MPedestalCam.cc
r2244 r2377 53 53 fTitle = title ? title : "Storage container for all Pedestal Information in the camera"; 54 54 55 fArray = new TClonesArray("MPedestalPix", 577);55 fArray = new TClonesArray("MPedestalPix", 1); 56 56 57 for (int i=0; i<577; i++)58 new ((*fArray)[i]) MPedestalPix;57 // for (int i=0; i<577; i++) 58 // new ((*fArray)[i]) MPedestalPix; 59 59 } 60 60 -
trunk/MagicSoft/Mars/manalysis/Makefile
r2300 r2377 35 35 MMcPedestalCopy.cc \ 36 36 MMcPedestalNSBAdd.cc \ 37 MGeomApply.cc \ 37 38 MCurrents.cc \ 38 39 MEnergyEst.cc \ -
trunk/MagicSoft/Mars/mbase/MArgs.cc
r2296 r2377 28 28 // MArgs 29 29 // 30 // This is a helper class for executables to parse command line arguments 31 // 30 32 ////////////////////////////////////////////////////////////////////////////// 31 33 #include "MArgs.h" … … 46 48 } 47 49 50 // -------------------------------------------------------------------------- 51 // 52 // Initializes: 53 // fName: The name of the executable 54 // fArgv: A TList containing all other command line arguments 55 // 48 56 MArgs::MArgs(int argc, const char **argv) : fArgc(argc) 49 57 { … … 61 69 } 62 70 71 // -------------------------------------------------------------------------- 72 // 73 // Deletes fArgv. 74 // 63 75 MArgs::~MArgs() 64 76 { … … 66 78 } 67 79 80 // -------------------------------------------------------------------------- 81 // 82 // Print all arguments parsed. 83 // 68 84 void MArgs::Print(const Option_t *o) const 69 85 { … … 72 88 } 73 89 90 // -------------------------------------------------------------------------- 91 // 92 // Return the Integer corresponding to the command line argument 'name' 93 // eg. executable -argument 5 94 // GetInt("argument") will return 5 95 // 74 96 Int_t MArgs::GetInt(const TString name) const 75 97 { … … 77 99 } 78 100 101 // -------------------------------------------------------------------------- 102 // 103 // Return the floating point value corresponding to the command line argument 104 // 'name' 105 // eg. executable -argument 5.7 106 // GetFloat("argument") will return 5.7 107 // 79 108 Double_t MArgs::GetFloat(const TString name) const 80 109 { … … 82 111 } 83 112 113 // -------------------------------------------------------------------------- 114 // 115 // Return the TString corresponding to the command line argument 'name' 116 // eg. executable -argument=last 117 // GetString("-argument=") will return "last" 118 // 84 119 TString MArgs::GetString(const TString name) const 85 120 { … … 92 127 } 93 128 129 // -------------------------------------------------------------------------- 130 // 131 // Return the Integer corresponding to the command line argument 'name' 132 // eg. executable -argument5 133 // GetIntAndRemove("-argument") will return 5 134 // and removes the argument from the internal list. 135 // 94 136 Int_t MArgs::GetIntAndRemove(const TString name) 95 137 { … … 97 139 } 98 140 141 // -------------------------------------------------------------------------- 142 // 143 // Return the floating point value corresponding to the command line argument 144 // 'name' 145 // eg. executable -argument5.7 146 // GetFloatAndRemove("-argument") will return 5.7 147 // and removes the argument from the internal list. 148 // 99 149 Double_t MArgs::GetFloatAndRemove(const TString name) 100 150 { … … 102 152 } 103 153 154 // -------------------------------------------------------------------------- 155 // 156 // Return the TString corresponding to the command line argument 'name' 157 // eg. executable -argument=last 158 // GetStringAndRemove("-argument=") will return "last" 159 // and removes the argument from the internal list. 160 // 104 161 TString MArgs::GetStringAndRemove(const TString n) 105 162 { … … 118 175 } 119 176 177 // -------------------------------------------------------------------------- 178 // 179 // Return the Integer corresponding to the i-th argument. This is ment 180 // for enumerations like 181 // executable 1 7 2 182 // GetArgumentInt(1) will return 7 183 // 120 184 Int_t MArgs::GetArgumentInt(Int_t i) const 121 185 { … … 123 187 } 124 188 189 // -------------------------------------------------------------------------- 190 // 191 // Return the floating point value corresponding to the i-th argument. 192 // This is ment for enumerations like 193 // executable 1.7 7.5 2.3 194 // GetArgumentFloat(1) will return 7.5 195 // 125 196 Float_t MArgs::GetArgumentFloat(Int_t i) const 126 197 { … … 128 199 } 129 200 201 // -------------------------------------------------------------------------- 202 // 203 // Return the TString corresponding to the i-th argument. 204 // This is ment for enumerations like 205 // executable file1 file2 file3 206 // GetArgumentStr(1) will return "file2" 207 // Only arguments without a trailing '-' are considered 208 // 130 209 TString MArgs::GetArgumentStr(Int_t i) const 131 210 { … … 146 225 } 147 226 227 // -------------------------------------------------------------------------- 228 // 229 // return the number of arguments without a trainling '-' 230 // 148 231 Int_t MArgs::GetNumArguments() const 149 232 { … … 159 242 } 160 243 244 // -------------------------------------------------------------------------- 245 // 246 // Checks whether an argument beginning with 'n' is existing, eg: 247 // executable -value5 248 // executable -value 249 // HasOption("-value") will return true in both cases 250 // 161 251 Bool_t MArgs::Has(const TString n) const 162 252 { … … 171 261 } 172 262 263 // -------------------------------------------------------------------------- 264 // 265 // Checks whether an argument beginning with 'n' is exists and a 266 // corresponding option is available, eg. 267 // executable -value5 268 // HasOption("-value") will return true 269 // but: 270 // executable -value 271 // HasOption("-value") will return false 272 // 173 273 Bool_t MArgs::HasOption(const TString n) const 174 274 { -
trunk/MagicSoft/Mars/mbase/MDirIter.cc
r2180 r2377 179 179 } 180 180 181 // -------------------------------------------------------------------------- 182 // 183 // Returns the concatenation of 'dir' and 'name' 184 // 181 185 TString MDirIter::ConcatFileName(const char *dir, const char *name) const 182 186 { -
trunk/MagicSoft/Mars/mdatacheck/MGDisplayAdc.cc
r2173 r2377 99 99 fSlider = new TGVSlider(mid, 250, kSlider1|kScaleBoth, M_VSId1); 100 100 fSlider->Associate(this); 101 fSlider->SetRange(1, 577);102 101 103 102 fList->Add(fSlider); … … 258 257 259 258 // 260 // Here the initial display is set to hitogram 0259 // Here the initial display is set to entry with id 1 261 260 // 262 261 fHistoList->Select(1); … … 305 304 const Int_t nhi = fHists->GetEntries(); 306 305 306 Int_t n=1; 307 307 for (Int_t i=0; i<nhi; i++) 308 308 if (fHists->HasHi(i)) 309 fHistoList->AddEntry(fHists->GetHistHi(i)->GetName(), i+1); 309 fHistoList->AddEntry(fHists->GetHistHi(i)->GetName(), n++); 310 311 fSlider->SetRange(1, n); 310 312 311 313 fHistoList->MapSubwindows(); … … 329 331 fCanvas->Clear(); 330 332 331 const Int_t idx = selected-1;333 const Int_t idx = fHistoList->GetSelectedEntry()->EntryId(); //selected-1; 332 334 333 335 if (!fHists->HasHi(idx)) … … 414 416 415 417 if ((parm1==M_BUTTON_PREV && selected==1) || 416 (parm1==M_BUTTON_NEXT && selected== 577))418 (parm1==M_BUTTON_NEXT && selected==fHistoList->GetNumberOfEntries())) 417 419 return kTRUE; 418 420 … … 448 450 449 451 // Check for the slider movement and synchronise with TGListBox 450 if (parm2<1 || parm2> 577)452 if (parm2<1 || parm2>fHistoList->GetNumberOfEntries()) 451 453 return kTRUE; 452 454 -
trunk/MagicSoft/Mars/meventdisp/MGCamDisplay.cc
r2275 r2377 38 38 #include "MTaskList.h" // MTaskList::AddToList 39 39 #include "MHCamera.h" // MHCamera 40 #include "MGeomApply.h" // MGeomApply 40 41 #include "MHillasCalc.h" // MHillasCalc 41 42 #include "MHillasSrcCalc.h" // MHillasSrcCalc … … 43 44 #include "MPedestalCam.h" // MPedestalCam 44 45 #include "MCerPhotEvt.h" // MCerPhotEvt::GetPixById 45 #include "MCerPhotCalc.h" // MCerPhotCalc46 #include "MCerPhotCalc.h" // MCerPhotCalc 46 47 #include "MMcPedestalCopy.h" // MMcPedestalCopy 47 48 #include "MMcPedestalNSBAdd.h" // MMcPedestalNSBAdd 48 49 #include "MBlindPixelCalc.h" // MBlindPixelCalc 49 50 #include "MImgCleanStd.h" // MImgCleanStd 50 #include "MGeomCamMagic.h" // MGeomMagicCam51 //#include "MGeomCamMagic.h" // MGeomMagicCam 51 52 #include "MRawEvtData.h" // MRawEvtData 52 53 … … 116 117 // preprocess tasks and read in first event (process) 117 118 // 118 MGeomCam *MGCamDisplay::SetupTaskList()119 void /*MGeomCam */MGCamDisplay::SetupTaskList() 119 120 { 120 121 MTaskList *tlist = GetTaskList(); 121 122 MParList *plist = GetParList(); 122 123 124 MGeomApply *apply = new MGeomApply; 123 125 MMcPedestalCopy *pcopy = new MMcPedestalCopy; 124 126 MMcPedestalNSBAdd *pdnsb = new MMcPedestalNSBAdd; … … 130 132 MHillasSrcCalc *scalc = new MHillasSrcCalc; 131 133 134 tlist->AddToList(apply); 132 135 tlist->AddToList(pcopy); 133 136 tlist->AddToList(pdnsb); … … 139 142 tlist->AddToList(scalc); 140 143 141 MGeomCamMagic *geom = new MGeomCamMagic;144 // MGeomCamMagic *geom = new MGeomCamMagic; 142 145 MPedestalCam *pedest = new MPedestalCam; 143 146 MRawEvtData *event = new MRawEvtData; 144 147 145 plist->AddToList(geom);148 // plist->AddToList(geom); 146 149 plist->AddToList(pedest); 147 150 plist->AddToList(event); 148 151 149 return geom;152 // return NULL; 150 153 } 151 154 … … 161 164 // Setup Task list for hillas calculation 162 165 // 163 MGeomCam *geom =SetupTaskList();166 /*MGeomCam *geom = */SetupTaskList(); 164 167 165 168 // … … 181 184 { 182 185 fCanvas2[i]->cd(); 183 fDisplay[i] = new MHCamera (*geom);186 fDisplay[i] = new MHCamera;//(*geom); 184 187 fDisplay[i]->Draw(); 185 188 fDisplay[i]->AddNotify(*(MCamEvent*)GetParList()->FindObject("MRawEvtData")); … … 221 224 // together with the hillas ellipse or not. 222 225 // 226 #include <iostream.h> 223 227 void MGCamDisplay::UpdateDisplay() 224 228 { … … 227 231 228 232 const MParList *plist = fEvtLoop->GetParList(); 233 234 if (!fDisplay[0]->GetGeometry()) 235 { 236 MGeomCam *cam = (MGeomCam*)plist->FindObject("MGeomCam"); 237 for (int i=0; i<5; i++) 238 { 239 fDisplay[i]->SetGeometry(*cam); 240 cout << "---> Setting geometry for: " << fDisplay[i]->GetName() << endl; 241 } 242 } 229 243 230 244 // … … 257 271 const MPedestalCam *ped = (MPedestalCam*)plist->FindObject("MPedestalCam"); 258 272 273 const Int_t n = ped->GetSize(); 274 259 275 // FIXME: Make this publicly available 260 TArrayD val( 577);261 TArrayC use( 577);262 for (int i=0; i< 577;i++)276 TArrayD val(n); 277 TArrayC use(n); 278 for (int i=0; i<n;i++) 263 279 { 264 280 // FIXME: photon event first! -
trunk/MagicSoft/Mars/meventdisp/MGCamDisplay.h
r2210 r2377 25 25 void UpdateDisplay(); 26 26 27 MGeomCam *SetupTaskList();27 void /*MGeomCam */SetupTaskList(); 28 28 29 29 public: -
trunk/MagicSoft/Mars/meventdisp/MGEvtDisplay.cc
r2275 r2377 278 278 279 279 AddTab("Geometry"); 280 280 281 MGeomCamMagic geom; 281 282 MHCamera *display = new MHCamera(geom); -
trunk/MagicSoft/Mars/mfileio/MReadCurrents.cc
r2206 r2377 24 24 25 25 ///////////////////////////////////////////////////////////////////////////// 26 // //27 // MReadCurrents //28 // //29 // Input Containers: //30 // -/- //31 // //32 // Output Containers: //33 // MCerPhotEvt //34 // //26 // 27 // MReadCurrents 28 // 29 // Input Containers: 30 // -/- 31 // 32 // Output Containers: 33 // MCerPhotEvt 34 // 35 35 ///////////////////////////////////////////////////////////////////////////// 36 36 #include "MReadCurrents.h" … … 63 63 const char *name, 64 64 const char *title) 65 : fIn(NULL) 65 : fIn(NULL), fNumPixel(577) 66 66 { 67 67 fName = name ? name : "MReadCurrents"; … … 225 225 fTime->SetTime(h, m, s, ms*1000000); 226 226 227 for (int i=0; i< 577; i++)227 for (int i=0; i<fNumPixel; i++) 228 228 *fIn >> (*fCurrents)[i]; 229 229 -
trunk/MagicSoft/Mars/mfileio/MReadCurrents.h
r2206 r2377 18 18 TList *fFileNames; // Array which stores the \0-terminated filenames 19 19 20 Int_t fNumPixel; 21 20 22 Bool_t OpenNextFile(); 21 23 … … 32 34 Int_t Process(); 33 35 36 void SetNumPixel(Int_t i) { fNumPixel=i; } 37 34 38 ClassDef(MReadCurrents, 0) // Reads a Central Control currents file 35 39 }; -
trunk/MagicSoft/Mars/mfileio/MWriteRootFile.cc
r2173 r2377 96 96 //fTrees.SetOwner(); 97 97 98 TString str(fname); 99 if (!str.EndsWith(".root", TString::kIgnoreCase)) 100 str += ".root"; 101 98 102 // 99 103 // Open the rootfile 100 104 // 101 fOut = new TFile( fname, opt, ftitle, comp);105 fOut = new TFile(str, opt, ftitle, comp); 102 106 } 103 107 -
trunk/MagicSoft/Mars/mgeom/GeomLinkDef.h
r2283 r2377 5 5 #pragma link off all functions; 6 6 7 #pragma link C++ class MGeomPix+; 8 #pragma link C++ class MGeomCam+; 7 9 #pragma link C++ class MGeomPMT+; 8 10 #pragma link C++ class MGeomMirror+; 9 11 #pragma link C++ class MGeomCorsikaCT+; 10 #pragma link C++ class MGeomPix+; 11 #pragma link C++ class MGeomCam+; 12 12 13 #pragma link C++ class MGeomCamCT1+; 13 14 #pragma link C++ class MGeomCamCT1Daniel+; 15 14 16 #pragma link C++ class MGeomCamMagic+; 15 17 #pragma link C++ class MGeomCamMagicHG+; 16 18 #pragma link C++ class MGeomCamMagic919+; 19 17 20 #pragma link C++ class MGeomCamECO1000+; 18 21 #pragma link C++ class MGeomCamECO1000HG+; -
trunk/MagicSoft/Mars/mhist/MHCamera.cc
r2327 r2377 78 78 using namespace std; 79 79 80 // ------------------------------------------------------------------------ 81 // 82 // Default Constructor. To be used by the root system ONLY. 83 // 84 MHCamera::MHCamera() : TH1D(), fGeomCam(NULL), fColors(kItemsLegend) 80 void MHCamera::Init() 85 81 { 86 82 SetDirectory(NULL); 87 83 88 fNotify = NULL; 84 SetLineColor(kGreen); 85 SetMarkerStyle(kFullDotMedium); 86 SetXTitle("Pixel Index"); 87 88 fNotify = new TList; 89 89 90 90 #if ROOT_VERSION_CODE < ROOT_VERSION(3,01,06) … … 97 97 // ------------------------------------------------------------------------ 98 98 // 99 // Default Constructor. To be used by the root system ONLY. 100 // 101 MHCamera::MHCamera() : TH1D(), fGeomCam(NULL), fColors(kItemsLegend) 102 { 103 Init(); 104 } 105 106 // ------------------------------------------------------------------------ 107 // 99 108 // Constructor. Makes a clone of MGeomCam. Removed the TH1D from the 100 109 // current directory. Calls Sumw2(). Set the histogram line color … … 102 111 // 103 112 MHCamera::MHCamera(const MGeomCam &geom, const char *name, const char *title) 104 : TH1D(name, title, geom.GetNumPixels(), -0.5, geom.GetNumPixels()-0.5), 105 fUsed(geom.GetNumPixels()), fColors(kItemsLegend) 106 { 107 fGeomCam = (MGeomCam*)geom.Clone(); 108 109 SetDirectory(NULL); 110 Sumw2(); 111 112 SetLineColor(kGreen); 113 SetMarkerStyle(kFullDotMedium); 114 SetXTitle("Pixel Index"); 115 116 fNotify = new TList; 117 118 // 119 // create the hexagons of the display 113 : fGeomCam(NULL), /*TH1D(name, title, geom.GetNumPixels(), -0.5, geom.GetNumPixels()-0.5), 114 fUsed(geom.GetNumPixels()),*/ fColors(kItemsLegend) 115 { 116 //fGeomCam = (MGeomCam*)geom.Clone(); 117 SetGeometry(geom, name, title); 118 Init(); 119 120 120 // 121 121 // root 3.02 … … 123 123 // register BIT(8) as kNoContextMenu. If an object has this bit set it will 124 124 // not get an automatic context menu when clicked with the right mouse button. 125 126 // 127 // Construct all hexagons. Use new-operator with placement 128 // 125 } 126 127 void MHCamera::SetGeometry(const MGeomCam &geom, const char *name, const char *title) 128 { 129 SetNameTitle(name, title); 130 131 TAxis &x = *GetXaxis(); 132 133 SetBins(geom.GetNumPixels(), 0, 1); 134 x.Set(geom.GetNumPixels(), -0.5, geom.GetNumPixels()-0.5); 135 136 //SetBins(geom.GetNumPixels(), -0.5, geom.GetNumPixels()-0.5); 137 //Rebuild(); 138 139 Sumw2(); // necessary? 140 141 if (fGeomCam) 142 delete fGeomCam; 143 fGeomCam = (MGeomCam*)geom.Clone(); 144 145 fUsed.Set(geom.GetNumPixels()); 129 146 for (Int_t i=0; i<fNcells-2; i++) 130 147 ResetUsed(i); 131 148 132 #if ROOT_VERSION_CODE < ROOT_VERSION(3,01,06)133 SetPalette(1, 0);134 #else135 SetPalette(51, 0);136 #endif137 149 } 138 150 … … 229 241 Int_t MHCamera::Fill(Axis_t x, Axis_t y, Stat_t w) 230 242 { 243 if (fNcells<=1) 244 return -1; 245 231 246 for (Int_t idx=0; idx<fNcells-2; idx++) 232 247 { … … 243 258 Stat_t MHCamera::GetMean(Int_t axis) const 244 259 { 260 if (fNcells<=1) 261 return 0; 262 245 263 Stat_t mean = 0; 246 264 for (int i=1; i<fNcells-1; i++) … … 252 270 Stat_t MHCamera::GetRMS(Int_t axis) const 253 271 { 272 if (fNcells<=1) 273 return -1; 274 254 275 const Int_t n = fNcells-2; 255 276 … … 278 299 return fMinimum; 279 300 301 if (fNcells<=1) 302 return 0; 303 280 304 Double_t minimum=FLT_MAX; 281 305 … … 304 328 if (fMaximum != -1111) 305 329 return fMaximum; 330 331 if (fNcells<=1) 332 return 1; 306 333 307 334 Double_t maximum=-FLT_MAX; … … 491 518 void MHCamera::Paint(Option_t *o) 492 519 { 520 if (fNcells<=1) 521 return; 522 493 523 TString opt(o); 494 524 opt.ToLower(); … … 585 615 void MHCamera::DrawPixelIndices() 586 616 { 617 if (fNcells<=1) 618 return; 619 587 620 // FIXME: Is this correct? 588 621 for (int i=0; i<kItemsLegend; i++) … … 609 642 void MHCamera::DrawSectorIndices() 610 643 { 644 if (fNcells<=1) 645 return; 646 611 647 for (int i=0; i<kItemsLegend; i++) 612 648 fColors[i] = 16; … … 637 673 void MHCamera::AddCamContent(const MCamEvent &event, Int_t type) 638 674 { 675 if (fNcells<=1) 676 return; 677 639 678 // FIXME: Security check missing! 640 679 for (Int_t idx=0; idx<fNcells-2; idx++) … … 717 756 void MHCamera::CntCamContent(const MCamEvent &event, Double_t threshold, Int_t type) 718 757 { 758 if (fNcells<=1) 759 return; 760 719 761 // FIXME: Security check missing! 720 762 for (Int_t idx=0; idx<fNcells-2; idx++) … … 757 799 void MHCamera::FillRandom() 758 800 { 801 if (fNcells<=1) 802 return; 803 759 804 Reset(); 760 805 … … 775 820 void MHCamera::FillLevels(const MCerPhotEvt &event, Float_t lvl1, Float_t lvl2) 776 821 { 822 if (fNcells<=1) 823 return; 824 777 825 SetCamContent(event, 2); 778 826 … … 807 855 void MHCamera::Reset(Option_t *opt) 808 856 { 857 if (fNcells<=1) 858 return; 859 809 860 TH1::Reset(opt); 810 861 … … 965 1016 Int_t MHCamera::DistancetoPrimitive(Int_t px, Int_t py) 966 1017 { 1018 if (fNcells<=1) 1019 return 999999; 1020 967 1021 const Int_t kMaxDiff = 7; 968 1022 … … 1014 1068 Int_t MHCamera::GetPixelIndex(Int_t px, Int_t py) const 1015 1069 { 1070 if (fNcells<=1) 1071 return -1; 1072 1016 1073 Int_t i; 1017 1074 for (i=0; i<fNcells-2; i++) -
trunk/MagicSoft/Mars/mhist/MHCamera.h
r2298 r2377 38 38 39 39 //TGStatusBar *fStatusBar; 40 void Init(); 40 41 41 42 Int_t GetColor(Float_t val, Float_t min, Float_t max, Bool_t islog); … … 72 73 MHCamera(const MGeomCam &geom, const char *name="", const char *title=""); 73 74 ~MHCamera(); 75 76 void SetGeometry(const MGeomCam &geom, const char *name="", const char *title=""); 77 const MGeomCam* GetGeometry() const { return fGeomCam; } 74 78 75 79 Bool_t IsUsed(Int_t idx) const { return TESTBIT(const_cast<TArrayC&>(fUsed)[idx], kIsUsed); } -
trunk/MagicSoft/Mars/mhist/MHCurrents.cc
r2191 r2377 53 53 void MHCurrents::Clear(const Option_t *) 54 54 { 55 const Int_t n = fCam ? fCam->GetNumPixels() : 577; 56 55 57 // FIXME: Implement a clear function with setmem 56 for (int i=0; i<577; i++) 58 fSum.Set(n); // also clears memory 59 fRms.Set(n); 60 /* for (int i=0; i<577; i++) 57 61 { 58 62 fSum[i] = 0; 59 63 fRms[i] = 0; 60 } 64 }*/ 61 65 62 66 fEntries = 0; … … 69 73 // 70 74 MHCurrents::MHCurrents(const char *name, const char *title) 71 : fSum(577), fRms(577),fCam(NULL), fEvt(NULL), fDispl(NULL)75 : /*fSum(577), fRms(577), */fCam(NULL), fEvt(NULL), fDispl(NULL) 72 76 { 73 77 // … … 113 117 114 118 fCam = (MGeomCam*)plist->FindObject("MGeomCam"); 115 if (!fCam) 116 *fLog << warn << GetDescriptor() << ": No MGeomCam found." << endl; 119 /* 120 if (!fCam) 121 *fLog << warn << GetDescriptor() << ": No MGeomCam found... assuming Magic geometry!" << endl; 122 */ 123 if (!fCam) 124 { 125 *fLog << err << GetDescriptor() << ": No MGeomCam found... aborting." << endl; 126 return kFALSE; 127 } 117 128 118 129 Clear(); 119 130 131 const Int_t n = fSum.GetSize(); 132 120 133 MBinning bins; 121 bins.SetEdges( 577, -0.5, 576.5);134 bins.SetEdges(n, -0.5, n-0.5); 122 135 bins.Apply(fHist); 123 136 … … 138 151 } 139 152 140 for (UInt_t idx=0; idx<577; idx++) 153 const Int_t n = fSum.GetSize(); 154 for (UInt_t idx=0; idx<n; idx++) 141 155 { 142 156 Float_t val; … … 166 180 } 167 181 168 for (UInt_t i=0; i<577; i++) 182 const Int_t n = fSum.GetSize(); 183 for (UInt_t i=0; i<n; i++) 169 184 { 170 185 // calc sdev^2 for pixel index i -
trunk/MagicSoft/Mars/mhist/MHFadcCam.cc
r2333 r2377 37 37 #include "MLogManip.h" 38 38 39 #include "MParList.h" 40 #include "MGeomCam.h" 41 39 42 #include "MRawEvtData.h" 40 43 #include "MRawEvtPixelIter.h" … … 49 52 // creates an a list of histograms for all pixels and both gain channels 50 53 // 51 MHFadcCam::MHFadcCam( const Int_t n,MHFadcPix::Type_t t, const char *name, const char *title)54 MHFadcCam::MHFadcCam(/*const Int_t n,*/ MHFadcPix::Type_t t, const char *name, const char *title) 52 55 : fNumHiGains(-1), fNumLoGains(-1), fType(t) 53 56 { … … 63 66 // connect all the histogram with the container fHist 64 67 // 65 fArray = new TObjArray(n); 68 fArray = new TObjArray; 69 fArray->SetOwner(); 66 70 67 for (Int_t i=0; i<n; i++)68 (*fArray)[i] = new MHFadcPix(i, fType);71 // for (Int_t i=0; i<n; i++) 72 // (*fArray)[i] = new MHFadcPix(i, fType); 69 73 } 70 74 … … 87 91 // FIXME, this might be done faster and more elegant, by direct copy. 88 92 // 89 MHFadcCam *cam = new MHFadcCam(n); 93 MHFadcCam *cam = new MHFadcCam(fType); 94 95 cam->fArray->Expand(n); 90 96 91 97 for (int i=0; i<n; i++) … … 95 101 } 96 102 return cam; 103 } 104 105 // -------------------------------------------------------------------------- 106 // 107 // To setup the object we get the number of pixels from a MGeomCam object 108 // in the Parameter list. 109 // 110 Bool_t MHFadcCam::SetupFill(const MParList *pList) 111 { 112 MGeomCam *cam = (MGeomCam*)pList->FindObject("MGeomCam"); 113 if (!cam) 114 { 115 *fLog << err << "MGeomCam (Camera Geometry) missing in Parameter List... aborting." << endl; 116 return kFALSE; 117 } 118 119 const Int_t n = cam->GetNumPixels(); 120 121 fArray->Delete(); 122 fArray->Expand(n); 123 124 for (Int_t i=0; i<n; i++) 125 (*fArray)[i] = new MHFadcPix(i, fType); 126 127 return kTRUE; 97 128 } 98 129 -
trunk/MagicSoft/Mars/mhist/MHFadcCam.h
r2333 r2377 33 33 34 34 public: 35 MHFadcCam( const Int_t n=577,MHFadcPix::Type_t t=MHFadcPix::kValue, const char *name=NULL, const char *title=NULL);35 MHFadcCam(/*const Int_t n=577,*/ MHFadcPix::Type_t t=MHFadcPix::kValue, const char *name=NULL, const char *title=NULL); 36 36 ~MHFadcCam(); 37 37 … … 45 45 const TH1F *GetHistLo(UInt_t i) const { return (*this)[i].GetHistLo(); } 46 46 47 Bool_t SetupFill(const MParList *pList); 47 48 Bool_t Fill(const MParContainer *par, const Stat_t w=1); 48 49 Bool_t Fill(const MRawEvtData *par); -
trunk/MagicSoft/Mars/mhist/MHTriggerLvl0.cc
r2298 r2377 100 100 MGeomCam *cam = (MGeomCam*)plist->FindObject("MGeomCam"); 101 101 if (!cam) 102 *fLog << warn << GetDescriptor() << ": No MGeomCam found." << endl; 102 { 103 *fLog << err << GetDescriptor() << ": No MGeomCam found... aborting." << endl; 104 return kFALSE; 105 } 103 106 104 107 if (fSum) -
trunk/MagicSoft/Mars/mimage/MImgCleanTGB.cc
r2296 r2377 257 257 #include <TGFrame.h> // TGFrame 258 258 #include <TGLabel.h> // TGLabel 259 #include <TArrayC.h> // TArrayC 259 260 #include <TGTextEntry.h> // TGTextEntry 260 261 … … 481 482 Double_t sdev = sqrt(sq/w2 - mean*mean); 482 483 483 Byte_t *nb = new Byte_t[1000]; 484 memset(nb, 0, 577); 484 TArrayC n(fCam->GetNumPixels()); 485 Byte_t *nb = (Byte_t*)n.GetArray(); 486 //Byte_t *nb = new Byte_t[1000]; 487 //memset(nb, 0, 577); 485 488 486 489 for (Int_t i=0; i<entries; i++) … … 512 515 //CleanStep3(nb, 2, 3); 513 516 514 delete nb;515 516 517 return kTRUE; 517 518 } -
trunk/MagicSoft/Mars/mmain/MDataCheck.cc
r2333 r2377 23 23 ! 24 24 \* ======================================================================== */ 25 26 25 #include "MDataCheck.h" 27 26 … … 35 34 #include "MTaskList.h" 36 35 #include "MReadTree.h" 36 #include "MGeomApply.h" 37 37 #include "MGDisplayAdc.h" 38 38 39 #include "MLog.h" 40 #include "MLogManip.h" 41 42 ClassImp(MDataCheck); 43 44 using namespace std; 45 39 46 // --- 40 41 ClassImp(MDataCheck)42 47 43 48 enum { … … 120 125 read.DisableAutoScheme(); 121 126 122 MHFadcCam hist(577, t); 127 MGeomApply geomapl; 128 129 MHFadcCam hist(t); 123 130 plist.AddToList(&hist); 124 131 … … 126 133 127 134 tasks.AddToList(&read); 135 tasks.AddToList(&geomapl); 128 136 tasks.AddToList(&fill); 129 137
Note:
See TracChangeset
for help on using the changeset viewer.