Changeset 2489 for trunk


Ignore:
Timestamp:
11/08/03 09:20:10 (21 years ago)
Author:
galante
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Mars
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/Changelog

    r2488 r2489  
    11                                                 -*-*- END OF LINE -*-*-
     2
     3 
     4  2003/11/08: Nicola Galante
     5
     6   * mhistmc/MHMcTriggerLvl2.[cc,h]:
     7     - Changed binning of histograms fHistLutPseudoSize, fHistLutPseudoSizeNorm,
     8       fHistSizeBiggerCell, fHistSizeBiggerCellNorm to fix an overflow bug
     9     - In method GetHistByName(const TString name): changed the class of the returned object,
     10       now it returns a (TObject *), no more a (TH1F *), in order to return
     11       either (TH1 *) than (TH2 *); changed the order by which it checks the name of the
     12       histogram in order to fix a bug in the lexing
     13
     14   * macros/triglvl2.C:
     15     - Added some instruction to write all the MMcTriggerLvl2 histograms into
     16       a TFile
     17
    218
    319  2003/11/07: Thomas Bretz
  • trunk/MagicSoft/Mars/macros/triglvl2.C

    r2370 r2489  
    3838   
    3939    tasklist.AddToList(&reader);
    40 
    4140    MGeomCamMagic geocam;
    4241    parlist.AddToList(&geocam);
     
    5554    // Set the number of Next Neighbourhoods that define a compact pixel
    5655    //
    57     cell.SetCompactNN(2);
     56    cell.SetCompactNN(3);
    5857    //  USER:       --^
    5958
     
    6160    //  A filter to select events using the L2T parameters is created
    6261    //
    63 
    6462    // MF lvl2filter("MMcTriggerLvl2.fPseudoSize > 25 && MMcTriggerLvl2.fPseudoSize < 31");
    65     MF lvl2filter("MMcTriggerLvl2.fPseudoSize > 15");
     63    //    MF lvl2filter("MMcTriggerLvl2.fSizeBiggerCell > 34");
     64    MF lvl2filter("MMcTriggerLvl2.fSizeBiggerCell > 18");
    6665 
    6766    //
     
    9089    MFilterList flist;
    9190    //flist.AddToList(&energyfilter);
    92     //flist.AddToList(&lvl2filter);
     91    flist.AddToList(&lvl2filter);
    9392    //   flist.AddToList(&selector);
    9493    //   flist.AddToList(&eslope);
    9594    //   flist.AddToList(&fTrig);
    9695
    97 
    98    
    9996    //
    10097    // The task to calculate the L2T parameter is added to the task list
     
    107104    //
    108105    tasklist.AddToList(&flist);
     106
     107
     108    MContinue L1offline ("MMcTriggerLvl2.fLutPseudoSize < 6");
     109    //    tasklist.AddToList(&L1offline);
    109110
    110111    //
     
    176177    // filled and can be displayd
    177178    //
    178     parlist.FindObject("MHMcCollectionArea")->DrawClone();
    179 
    180     parlist.FindObject("MHMcTriggerLvl2")->DrawClone("sbc");
    181     parlist.FindObject("MHMcTriggerLvl2")->DrawClone("lps");
    182     parlist.FindObject("MHMcTriggerLvl2")->DrawClone();
     179   
     180
     181    //parlist.FindObject("MHMcTriggerLvl2")->DrawClone("sbc");
     182    //parlist.FindObject("MHMcTriggerLvl2")->DrawClone("lps");
     183    //parlist.FindObject("MHMcTriggerLvl2")->DrawClone();
    183184    //parlist.FindObject("MHMcTriggerLvl2")->DrawClone("energy");
    184     parlist.FindObject("MHMcTriggerLvl2")->DrawClone("size-energy");
    185 
     185    //parlist.FindObject("MHMcTriggerLvl2")->DrawClone("lut-energy");
     186    //parlist.FindObject("MHMcCollectionArea")->DrawClone();
    186187    // Returns histogram of the class MHMcTriggerLvl2 
    187 
     188   
    188189    MHMcTriggerLvl2 *htrig = (MHMcTriggerLvl2 *)parlist.FindObject("MHMcTriggerLvl2");
    189     TH1F *h1 = (TH1F *)htrig->GetHistByName("fHistPseudoSize");
    190     TH2D *h2 = htrig->GetHistSizeBiggerCellEnergy();
    191     TH2D *h3 = (TH2D *)htrig->GetHistByName("fHistLutPseudoSizeEnergy");
    192     //csbce = new TCanvas();
    193     //h2->DrawClone();
    194 
    195     hfile = new TFile("HistFileLUT.root", "RECREATE");
    196     h1->Write();
    197     h2->Write();
    198     h3->Write();
     190    MHMcCollectionArea *collarea = (MHMcCollectionArea *)parlist.FindObject("MHMcCollectionArea");
     191    TH1F *hps = (TH1F *)htrig->GetHistByName("fHistPseudoSize");
     192    TH1F *hlps = (TH1F *)htrig->GetHistByName("fHistLutPseudoSize");
     193    TH1F *hsbc = (TH1F *)htrig->GetHistSizeBiggerCell();
     194    TH1F *hpsn = (TH1F *)htrig->GetHistByName("fHistPseudoSizeNorm");
     195    TH1F *hlpsn = (TH1F *)htrig->GetHistByName("fHistLutPseudoSizeNorm");
     196    TH1F *hsbcn = (TH1F *)htrig->GetHistSizeBiggerCellNorm();
     197    TH2D *hlpse = (TH2D *)htrig->GetHistByName("fHistLutPseudoSizeEnergy");
     198    TH2D *hpse = (TH2D *)htrig->GetHistByName("fHistPseudoSizeEnergy");
     199    TH2D *hsbce = (TH2D *)htrig->GetHistSizeBiggerCellEnergy();
     200    TH1D *hcollarea = collarea->GetHist();
     201
     202    // Please set rootfile as the directory where you want to store
     203    // your file.root containing histograms
     204    rootfile = new TString(filename);
     205    if (rootfile->Index("/*.root",1)>=0){
     206      rootfile->Resize(rootfile->Index("/*.root",1));
     207      rootfile[0]+="_sbcmag18_CNN3.root";
     208    }
     209     
     210    hfile = new TFile((char *)rootfile[0], "RECREATE");
     211    hlps->Write();
     212    hps->Write();
     213    hsbc->Write();
     214    hlpsn->Write();
     215    hpsn->Write();
     216    hsbcn->Write();
     217    hlpse->Write();
     218    hpse->Write();
     219    hsbce->Write();
     220    hcollarea->Write();
    199221    hfile->Close();
     222    cout << "Histograms stored into " << rootfile[0] << endl;
     223   
    200224
    201225}
  • trunk/MagicSoft/Mars/mhistmc/MHMcTriggerLvl2.cc

    r2399 r2489  
    7979    fTitle = title ? title : "Trigger L2 image parameters";
    8080
    81     fHistLutPseudoSize  = new TH1F("fHistLutPseudoSize",  "number of compact pixels in one lut",                12,   0, 12);
     81    fHistLutPseudoSize  = new TH1F("fHistLutPseudoSize",  "number of compact pixels in one lut",                13,   0, 13);
    8282    fHistPseudoSize     = new TH1F("fHistPseudoSize",   "Multiplicity of the cluster identified by the L2T",    397,   0, 397);
    83     fHistSizeBiggerCell  = new TH1F("fHistSizeBiggerCell",   "Number of fired pixel in bigger cell",            36,   0, 36);
    84 
    85     fHistLutPseudoSizeNorm  = new TH1F("fHistLutPseudoSizeNorm",  "Normalized Number of compact pixels in one lut",                12,   0, 12);
     83    fHistSizeBiggerCell  = new TH1F("fHistSizeBiggerCell",   "Number of fired pixel in bigger cell",            37,   0, 37);
     84
     85    fHistLutPseudoSizeNorm  = new TH1F("fHistLutPseudoSizeNorm",  "Normalized Number of compact pixels in one lut",                13,   0, 13);
    8686    fHistPseudoSizeNorm     = new TH1F("fHistPseudoSizeNorm",   "Normalized Multiplicity of the cluster identified by the L2T",    397,   0, 397);
    87     fHistSizeBiggerCellNorm  = new TH1F("fHistSizeBiggerCellNorm",   "Normalized Number of fired pixel in bigger cell",            36,   0, 36);
     87    fHistSizeBiggerCellNorm  = new TH1F("fHistSizeBiggerCellNorm",   "Normalized Number of fired pixel in bigger cell",            37,   0, 37);
    8888
    8989    fHistLutPseudoSize->SetDirectory(NULL);
     
    329329//  so remember to cast the returned object if you want to work with it.
    330330//
    331 TH1 *MHMcTriggerLvl2::GetHistByName(const TString name)
    332 {
     331TObject *MHMcTriggerLvl2::GetHistByName(const TString name) const
     332{
     333 
     334    if (name.Contains("fHistLutPseudoSizeEnergy", TString::kIgnoreCase))
     335        return fHistLutPseudoSizeEnergy;
     336    if (name.Contains("fHistSizeBiggerCellEnergy", TString::kIgnoreCase))
     337        return fHistSizeBiggerCellEnergy;
     338    if (name.Contains("fHistPseudoSizeEnergy", TString::kIgnoreCase))
     339        return fHistPseudoSizeEnergy;
     340
    333341    if (name.Contains("fHistLutPseudoSize", TString::kIgnoreCase))
    334342      return fHistLutPseudoSize;
     
    344352    if (name.Contains("fHistPseudoSizeNorm", TString::kIgnoreCase))
    345353        return fHistPseudoSizeNorm;
    346 
    347     if (name.Contains("fHistLutPseudoSizeEnergy", TString::kIgnoreCase))
    348         return fHistLutPseudoSizeEnergy;
    349     if (name.Contains("fHistSizeBiggerCellEnergy", TString::kIgnoreCase))
    350         return fHistSizeBiggerCellEnergy;
    351     if (name.Contains("fHistPseudoSizeEnergy", TString::kIgnoreCase))
    352         return fHistPseudoSizeEnergy;
    353354           
    354355    return NULL;
  • trunk/MagicSoft/Mars/mhistmc/MHMcTriggerLvl2.h

    r2399 r2489  
    4343    Bool_t Fill(const MParContainer *par, const Stat_t w=1);
    4444
    45     TH1 *GetHistByName(const TString name);
     45    TObject *GetHistByName(const TString name) const;
    4646
    4747    TH1F *GetHistLutPseudoSize() const { return fHistLutPseudoSize; }
Note: See TracChangeset for help on using the changeset viewer.