/* ======================================================================== *\ ! ! * ! * This file is part of MARS, the MAGIC Analysis and Reconstruction ! * Software. It is distributed to you in the hope that it can be a useful ! * and timesaving tool in analysing Data of imaging Cerenkov telescopes. ! * It is distributed WITHOUT ANY WARRANTY. ! * ! * Permission to use, copy, modify and distribute this software and its ! * documentation for any purpose is hereby granted without fee, ! * provided that the above copyright notice appear in all copies and ! * that both that copyright notice and this permission notice appear ! * in supporting documentation. It is provided "as is" without express ! * or implied warranty. ! * ! ! ! Author(s): Javier López, 04/2004 ! ! Copyright: MAGIC Software Development, 2000-2004 ! ! \* ======================================================================== */ /* #include #include #include #include #include #include "MParList.h" #include "MTaskList.h" #include "MGeomCamMagic.h" #include "MCameraDC.h" #include "MReadReports.h" #include "MGeomApply.h" #include "MEvtLoop.h" */ const Int_t gsNpix = 577; MGeomCamMagic geomcam; using namespace std; void AnalCurrents(const TString filename) { //UInt_t numEvents = 1000000; UInt_t numEvents = 1; // // Create a empty Parameter List and an empty Task List // The tasklist is identified in the eventloop by its name // MParList plist; MTaskList tlist; plist.AddToList(&tlist); MCameraDC dccam; plist.AddToList(&geomcam); plist.AddToList(&dccam); // // Now setup the tasks and tasklist: // --------------------------------- // // Reads the trees of the root file and the analysed branches MReadReports read; read.AddTree("Currents"); read.AddFile(filename); // after the reading of the trees!!! read.AddToBranchList("MReportCurrents.*"); MGeomApply geomapl; tlist.AddToList(&geomapl); tlist.AddToList(&read); // // Create and setup the eventloop // MEvtLoop evtloop; evtloop.SetParList(&plist); MCerPhotEvt dcevt; const Int_t NSteps = 5; // Number of steps to average DC over events Int_t count = 0; // counter for averaging NSteps events Int_t NumAverEvt = 1; // counter for averaged events stored into dcevt Double_t val[gsNpix]; // array for managing the averaging of gsNpix // DC values over NSteps events // Initialize to 0 array val for(Int_t i=0; iGetPixelContent(currDC,pixid,geomcam,0); Float_t maxDC = 0.0; // look for the max DC in the neighbors pixels for (Int_t j=0; j < pix->GetNumNeighbors(); j++) { evt->GetPixelContent(tempDC,pix->GetNeighbor(j),geomcam,0); if(tempDC > maxDC) maxDC = tempDC; } // a starting pixel was found: it is added to the array if ((currDC>maxDC) && (currDC>DCthr)) { startpixs->ResizeTo(++i); startpixs(i-1)=pixid; cout << "Starting pixel PixID=" << startpixs(i-1) << " curr=" << currDC << endl; } } if(startpixs->GetNrows()>0) { cout << "Number of starting pixels = " << startpixs->GetNrows() << endl; return 1; } else return 0; } /* Int_t FindCluster(Int_t startpix, Int_t cluster, MGeomCam *geom) { return 1; } */