Changeset 2365 for trunk/MagicSoft/Mars/macros
- Timestamp:
- 09/29/03 17:39:49 (21 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/macros/triglvl2.C
r1991 r2365 24 24 parlist.AddToList(&tasklist); 25 25 26 MGeomCamMagic geocam;27 parlist.AddToList(&geocam);28 29 // MHillas hillas;30 // parlist.AddToList(&hillas);31 32 // An instance of the class MMcTriggerLvl2 is created and added to the33 // parameter list34 MMcTriggerLvl2 cell;35 parlist.AddToList(&cell);36 37 // Set the number of Next Neighbourhoods that define a compact pixel38 //39 cell.SetCompactNN(3);40 // USER: --^41 42 //43 // A filter to select events using the L2T parameters is created44 //45 MF lvl2filter("MMcTriggerLvl2.fLutPseudoSize > 8");46 47 //48 // A second filter is created using the class MFTriggerLvl249 //50 MFTriggerLvl2 fTrig("MMcTriggerLvl2", '>', 8);51 // USER: fValue to be compared --^52 53 //54 // A selection on the number and energy of the events55 //56 MF energyfilter("MMcEvt.fEnergy > 100");57 MFEventSelector selector;58 //selector.SetNumSelectEvts(4000);59 60 61 // Filter to select events according to a give slope62 MFEnergySlope eslope;63 64 eslope.SetMcMinEnergy(50.);65 eslope.SetMcMaxEnergy(400.);66 eslope.SetNewSlope(-3.91);67 68 // A filter list is created; the filters created can be added to the list69 //70 MFilterList flist;71 // flist.AddToList(&energyfilter);72 // flist.AddToList(&lvl2filter);73 // flist.AddToList(&selector);74 // flist.AddToList(&eslope);75 flist.AddToList(&fTrig);76 77 78 26 // 79 27 // Setup our tasks: … … 81 29 // - Then we can fill the efficiency histograms 82 30 // 31 32 83 33 MReadMarsFile reader("Events", filename); 84 34 reader.DisableAutoScheme(); … … 89 39 tasklist.AddToList(&reader); 90 40 41 MGeomCamMagic geocam; 42 parlist.AddToList(&geocam); 43 44 // MHillas hillas; 45 // parlist.AddToList(&hillas); 46 47 // An instance of the class MMcTriggerLvl2 is created and added to the 48 // parameter list 49 MMcTriggerLvl2 cell; 50 parlist.AddToList(&cell); 51 52 MMcEvt mevt; 53 parlist.AddToList(&mevt); 54 55 // Set the number of Next Neighbourhoods that define a compact pixel 56 // 57 cell.SetCompactNN(2); 58 // USER: --^ 59 60 // 61 // A filter to select events using the L2T parameters is created 62 // 63 64 // MF lvl2filter("MMcTriggerLvl2.fPseudoSize > 25 && MMcTriggerLvl2.fPseudoSize < 31"); 65 MF lvl2filter("MMcTriggerLvl2.fPseudoSize > 15"); 66 67 // 68 // A second filter is created using the class MFTriggerLvl2 69 // 70 MFTriggerLvl2 fTrig("MMcTriggerLvl2", '>', 8); 71 // USER: fValue to be compared --^ 72 73 // 74 // A selection on the number and energy of the events 75 // 76 MF energyfilter("MMcEvt.fEnergy > 100"); 77 MFEventSelector selector; 78 //selector.SetNumSelectEvts(4000); 79 80 81 // Filter to select events according to a give slope 82 MFEnergySlope eslope; 83 84 eslope.SetMcMinEnergy(50.); 85 eslope.SetMcMaxEnergy(400.); 86 eslope.SetNewSlope(-.5); 87 88 // A filter list is created; the filters created can be added to the list 89 // 90 MFilterList flist; 91 //flist.AddToList(&energyfilter); 92 //flist.AddToList(&lvl2filter); 93 // flist.AddToList(&selector); 94 // flist.AddToList(&eslope); 95 // flist.AddToList(&fTrig); 96 97 98 99 // 100 // The task to calculate the L2T parameter is added to the task list 101 // 102 MMcTriggerLvl2Calc calcps("MMcTriggerLvl2","MMcTriggerLvl2"); 103 tasklist.AddToList(&calcps); 104 91 105 // 92 106 // The filter list is added to the task list … … 98 112 // 99 113 MMcCollectionAreaCalc effi; 100 tasklist.AddToList(&effi); 101 114 tasklist.AddToList(&effi); 102 115 // 103 116 // The filter list selects events for the effective area calculation … … 105 118 effi.SetFilter(&flist); 106 119 107 //108 // The task to calculate the L2T parameter is added to the task list109 //110 MMcTriggerLvl2Calc fill("MMcTriggerLvl2","MMcTriggerLvl2");111 tasklist.AddToList(&fill);112 120 113 121 // … … 116 124 MFillH hfill1("MHMcTriggerLvl2","MMcTriggerLvl2"); 117 125 tasklist.AddToList(&hfill1); 118 126 //hfill1.SetFilter(&flist); 127 //MFillH hfill2("MHMcTriggerLvl2", &mevt, &cell); 128 //tasklist.AddToList(&hfill2); 129 //hfill2.SetFilter(&flist); 130 131 132 119 133 // 120 134 // set up the loop for the processing … … 123 137 magic.SetParList(&parlist); 124 138 139 125 140 // 126 141 // Start to loop over all events … … 129 144 magic.SetProgressBar(&bar); 130 145 146 131 147 if (!magic.Eventloop()) 132 148 return; 149 /* 150 if (!magic.PreProcess()) 151 return; 152 153 while (tasklist.Process()) 154 { 155 cout<< mevt.GetEnergy()<<endl; 156 157 cell.Print(); 158 } 159 */ 160 //fMcEvt = (MMcEvt*)parlist->FindObject("MMcEvt"); 161 //if (!fMcEvt) 162 //{ 163 //cout << "MMcEvt not found... exit." << endl; 164 //*fLog << err << dbginf << "MMcEvt not found... exit." << endl; 165 // return kFALSE; 166 //} 167 // cout << "fMcEvt = " << fMcEvt << endl; 168 169 //parlist.FindObject("MHMcTriggerLvl2")->Fill((Double_t) fMcEvt->GetEnergy(), cell); 170 133 171 134 172 tasklist.PrintStatistics(); … … 140 178 parlist.FindObject("MHMcCollectionArea")->DrawClone(); 141 179 180 parlist.FindObject("MHMcTriggerLvl2")->DrawClone("sbc"); 142 181 parlist.FindObject("MHMcTriggerLvl2")->DrawClone("lps"); 143 // parlist.FindObject("MHMcTriggerLvl2")->DrawClone(); 182 parlist.FindObject("MHMcTriggerLvl2")->DrawClone(); 183 parlist.FindObject("MHMcTriggerLvl2")->DrawClone("energy"); 144 184 145 185 // Returns histogram of the class MHMcTriggerLvl2 146 // parlist.FindObject("MHMcTriggerLvl2")->GetHistByName("hfPseudoSize")); 147 186 187 MHMcTriggerLvl2 *htrig = (MHMcTriggerLvl2 *)parlist.FindObject("MHMcTriggerLvl2"); 188 TH1F *h1 = htrig->GetHistByName("fHistPseudoSize"); 189 TH2D *h2 = htrig->GetHistPseudoSizeEnergy(); 190 191 // h2->DrawClone(); 192 193 hfile = new TFile("HistFileLUT.root", "RECREATE"); 194 h1->Write(); 195 h2->Write(); 196 hfile->Close(); 197 148 198 } 149 199
Note:
See TracChangeset
for help on using the changeset viewer.