Difference: AnalysisSoftware (1 vs. 14)

Revision 132015-04-05 - TimBrooks

Line: 1 to 1
 
META TOPICPARENT name="BeamLineForSchools"
Changed:
<
<
>
>

Resources

 

SVN Repo

To checkout analysis code:

Line: 13 to 13
 One can see the websvn interface from the following address: https://svnweb.cern.ch/cern/wsvn/bl4sextras/BL4S_analysis
Changed:
<
<

Documentation

>
>

Doxygen

The source code is automatically documented at: http://test-bl4sdoc.web.cern.ch/test-bl4sdoc/

Development

Documentation

 The analysis library is documented using doxygen here: http://test-bl4sdoc.web.cern.ch/test-bl4sdoc/

CMT Tricks

Line: 153 to 160
 %ENDCODE%
Added:
>
>

Contacts

 -- CenkYildiz - 19 Mar 2014 -- CenkYildiz - 02 Jul 2014

-- SaimeSarikaya - 14 Jul 2014 \ No newline at end of file

Revision 122015-03-17 - TimBrooks

Line: 1 to 1
 
META TOPICPARENT name="BeamLineForSchools"
Line: 13 to 13
 One can see the websvn interface from the following address: https://svnweb.cern.ch/cern/wsvn/bl4sextras/BL4S_analysis
Added:
>
>

Documentation

The analysis library is documented using doxygen here: http://test-bl4sdoc.web.cern.ch/test-bl4sdoc/
 

CMT Tricks

Using an external shared object and header files in a program

Revision 112014-09-22 - CenkYildiz

Line: 1 to 1
 
META TOPICPARENT name="BeamLineForSchools"
Line: 29 to 29
 

How to use BL4SAnalysis library to read events

Reading events from a data file

Deleted:
<
<
 
Added:
>
>
%CODE{ lang="cpp" num="1" numstep="2" }%
  //Opening config file and setting congifuration BL4SConfig * cfg = new BL4SConfig("test.cfg");

Line: 69 to 71
  }

}

Changed:
<
<
>
>
%ENDCODE%
 

Reading events online

Changed:
<
<
>
>
%CODE{ lang="cpp" num="1" numstep="2" }%
  //Opening config file and setting congifuration BL4SConfig * cfg = new BL4SConfig("test.cfg");

Line: 110 to 114
  }

}

Changed:
<
<
>
>
%ENDCODE%
 

Geometry Class for detectors

Line: 121 to 125
  One can use the class as:
Changed:
<
<
>
>
%CODE{ lang="cpp" num="1" numstep="2" }%
  //Opening config file and setting congifuration BL4SConfig * cfg = new BL4SConfig("test.cfg");

Line: 141 to 147
  geo->GetLeadGlassPosition(i,x,y,z); cout << "Lead Glass " << i << ": x=" << x << ", y=" << y << ", z=" << z << endl; }
Changed:
<
<

>
>
%ENDCODE%
  -- CenkYildiz - 19 Mar 2014 -- CenkYildiz - 02 Jul 2014

Revision 102014-07-30 - CenkYildiz

Line: 1 to 1
 
META TOPICPARENT name="BeamLineForSchools"
Line: 119 to 119
  One should define a config a class first which will be input for the constructor of the Geometry class. from the config file number of detectors, verbosity and config file path is taken.
Changed:
<
<
It has public methods as:
    /// Constructor
    //fname is the name of the file to be opened for the geometry info.
    BL4SGeometry(string fname, BL4SConfig * _cfg);
    ~BL4SGeometry();

    /// Print all the read geometry elements
    void ShowGeometry();
    
    //Getters

    ///returns Beam Line Information  
    double GetBeamLineStart();
    double GetBeamLineEnd();
    double GetBeamLineBendPosition();
    double GetBeamLineBendAngle();

    //i is the number of the detector and one should provide x,y,z
    //to be filled after the method called
    ///Returns geometry of the DWC
    void GetDwcDimension(double& x, double& y, double& z);
    void GetDwcPosition(int i, double& x, double& y, double& z);
    
    ///Returns geometry of the LeadGlass
    void GetLeadGlassDimension(double& x, double& y, double&z);
    void GetLeadGlassPosition(int i, double& x, double& y, double&z);
    
    ///Returns geometry of the Scintillator
    void GetScintillatorDimension(double& x, double& y, double&z);
    void GetScintillatorPosition(int i, double& x, double& y, double&z);
    
    ///Returns geometry of the HaloCounter
    void GetHaloUpDimension(double& x, double& y, double&z);
    void GetHaloUpPosition (double& x, double& y, double&z);
    
    void GetHaloDownDimension(double& x, double& y, double&z);
    void GetHaloDownPosition (double& x, double& y, double&z);
    
    void GetHaloRightDimension(double& x, double& y, double&z);
    void GetHaloRightPosition (double& x, double& y, double&z);
    
    void GetHaloLeftDimension(double& x, double& y, double&z);
    void GetHaloLeftPosition (double& x, double& y, double&z);
    
    //Can be used to calculate what is the openning of the halo counter
    double HaloXOpening();
    double HaloYOpening();
   
    //Returns the number of detectors
    int GetNDwc();
    int GetNLeadGlass();
    int GetNScintillator();

For an example:

>
>
One can use the class as:
 
 //Opening config file and setting congifuration

Revision 92014-07-27 - CenkYildiz

Line: 1 to 1
 
META TOPICPARENT name="BeamLineForSchools"
Line: 10 to 10
 svn co svn+ssh://svn.cern.ch/reps/bl4sextras
Added:
>
>
One can see the websvn interface from the following address: https://svnweb.cern.ch/cern/wsvn/bl4sextras/BL4S_analysis
 

CMT Tricks

Using an external shared object and header files in a program

Revision 82014-07-26 - CenkYildiz

Line: 1 to 1
 
META TOPICPARENT name="BeamLineForSchools"
Line: 32 to 32
  BL4SConfig * cfg = new BL4SConfig("test.cfg");

//Creating instance of debug object, which handles verbosity

Changed:
<
<
BL4SDebug *debug = new BL4SDebug(cfg->verbosity);
>
>
BL4SDebug *debug = new BL4SDebug(cfg->GetVerbosity());
  //Opening data file BL4SDataFile * dat = new BL4SDataFile(datafilename,cfg);

//Getting important parameters int Nevents = dat->GetNumberOfEvents();

Changed:
<
<
int Ndwc = cfg->n_dwc; int Nlg = cfg->n_lead_glass; int Nscin = cfg->n_scintillator;
>
>
int Ndwc = cfg->GetNDwc(); int Nlg = cfg->GetNLeadGlass(); int Nscin = cfg->GetNScintillator();
  // Creating Calibration instance (to get some calibration constants and pedestal levels of VME modules/detectors) BL4SCalibration *cal = new BL4SCalibration(cfg,dat);
Line: 75 to 76
  BL4SConfig * cfg = new BL4SConfig("test.cfg");

//Creating instance of debug object, which handles verbosity

Changed:
<
<
BL4SDebug *debug = new BL4SDebug(cfg->verbosity);
>
>
BL4SDebug *debug = new BL4SDebug(cfg->GetVerbosity());
  //Getting important parameters
Changed:
<
<
int Ndwc = cfg->n_dwc; int Nlg = cfg->n_lead_glass; int Nscin = cfg->n_scintillator;
>
>
int Ndwc = cfg->GetNDwc(); int Nlg = cfg->GetNLeadGlass(); int Nscin = cfg->GetNScintillator();
  // Creating Calibration instance (to get some calibration constants and pedestal levels of VME modules/detectors) // Note that this time Datafile argument is not entered.

Revision 72014-07-15 - SaimeSarikaya

Line: 1 to 1
 
META TOPICPARENT name="BeamLineForSchools"
Line: 126 to 126
  void ShowGeometry();

//Getters

Added:
>
>
///returns Beam Line Information double GetBeamLineStart(); double GetBeamLineEnd(); double GetBeamLineBendPosition(); double GetBeamLineBendAngle();
  //i is the number of the detector and one should provide x,y,z //to be filled after the method called ///Returns geometry of the DWC
Line: 157 to 164
  double HaloXOpening(); double HaloYOpening();
Added:
>
>
//Returns the number of detectors int GetNDwc(); int GetNLeadGlass(); int GetNScintillator();
 

For an example:

Line: 175 to 187
  double x,y,z;

Changed:
<
<
for(int i=0;i<cfg->n_lead_glass;i++)
>
>
for(int i=0;i<geo->GetNLeadGlass();i++)
  { similar for other detectors. geo->GetLeadGlassPosition(i,x,y,z);

Revision 62014-07-14 - SaimeSarikaya

Line: 1 to 1
 
META TOPICPARENT name="BeamLineForSchools"
Line: 108 to 108
  }

Added:
>
>

Geometry Class for detectors

Geometry Class is finished.

One should define a config a class first which will be input for the constructor of the Geometry class. from the config file number of detectors, verbosity and config file path is taken.

It has public methods as:

    /// Constructor
    //fname is the name of the file to be opened for the geometry info.
    BL4SGeometry(string fname, BL4SConfig * _cfg);
    ~BL4SGeometry();

    /// Print all the read geometry elements
    void ShowGeometry();
    
    //Getters
    //i is the number of the detector and one should provide x,y,z
    //to be filled after the method called
    ///Returns geometry of the DWC
    void GetDwcDimension(double& x, double& y, double& z);
    void GetDwcPosition(int i, double& x, double& y, double& z);
    
    ///Returns geometry of the LeadGlass
    void GetLeadGlassDimension(double& x, double& y, double&z);
    void GetLeadGlassPosition(int i, double& x, double& y, double&z);
    
    ///Returns geometry of the Scintillator
    void GetScintillatorDimension(double& x, double& y, double&z);
    void GetScintillatorPosition(int i, double& x, double& y, double&z);
    
    ///Returns geometry of the HaloCounter
    void GetHaloUpDimension(double& x, double& y, double&z);
    void GetHaloUpPosition (double& x, double& y, double&z);
    
    void GetHaloDownDimension(double& x, double& y, double&z);
    void GetHaloDownPosition (double& x, double& y, double&z);
    
    void GetHaloRightDimension(double& x, double& y, double&z);
    void GetHaloRightPosition (double& x, double& y, double&z);
    
    void GetHaloLeftDimension(double& x, double& y, double&z);
    void GetHaloLeftPosition (double& x, double& y, double&z);
    
    //Can be used to calculate what is the openning of the halo counter
    double HaloXOpening();
    double HaloYOpening();

For an example:

 //Opening config file and setting congifuration
  BL4SConfig * cfg = new BL4SConfig("test.cfg");
  
  //Openning geometry file
  BL4SGeometry * geo = new BL4SGeometry("geometry_test.cfg", cfg);
  //showing info read
  geo->ShowGeometry();
  
  cout << "Halo counter x opening : " << geo->HaloXOpening() << endl;
  cout << "Halo counter y opening : " << geo->HaloYOpening() << endl;
  
  double x,y,z;
  
  for(int i=0;i<cfg->n_lead_glass;i++)
  {
    similar for other detectors.
    geo->GetLeadGlassPosition(i,x,y,z);
    cout << "Lead Glass " << i << ": x=" << x << ", y=" << y << ", z=" << z << endl;
  }


 -- CenkYildiz - 19 Mar 2014 -- CenkYildiz - 02 Jul 2014
Added:
>
>
-- SaimeSarikaya - 14 Jul 2014

Revision 52014-07-03 - CenkYildiz

Line: 1 to 1
 
META TOPICPARENT name="BeamLineForSchools"
Line: 44 to 44
  int Nscin = cfg->n_scintillator;

// Creating Calibration instance (to get some calibration constants and pedestal levels of VME modules/detectors)

Changed:
<
<
BL4SCalibration *cal = new BL4SCalibration(dat,cfg);
>
>
BL4SCalibration *cal = new BL4SCalibration(cfg,dat);
  vector rawev;

Line: 91 to 91
  //Main loop while(1) {
Changed:
<
<
// There should be a function to dump raw data from the DAQ into a vector. Here I use a made up method rawev = DumpEvent();
>
>
// One should copy raw data of next event from the DAQ into the rawev vector. Here I use a made up method, such method does not exist, replace it with your code. rawev = getNextRawEvent_dummy()
  //Creating BL4SEvent instance (that has information of signal on each detector) unique_ptr ev(new BL4SEvent(rawev,cfg,cal));

Revision 42014-07-02 - CenkYildiz

Line: 1 to 1
 
META TOPICPARENT name="BeamLineForSchools"
Line: 24 to 24
 macro myapplinkopts "-L/path/to/lib/ -lSomething"
Added:
>
>

How to use BL4SAnalysis library to read events

Reading events from a data file


  //Opening config file and setting congifuration
  BL4SConfig * cfg = new BL4SConfig("test.cfg");
    
  //Creating instance of debug object, which handles verbosity
  BL4SDebug *debug = new BL4SDebug(cfg->verbosity);
    
  //Opening data file
  BL4SDataFile * dat = new BL4SDataFile(datafilename,cfg);  
    
  //Getting important parameters
  int Nevents = dat->GetNumberOfEvents();
  int Ndwc    = cfg->n_dwc;
  int Nlg     = cfg->n_lead_glass;
  int Nscin   = cfg->n_scintillator;
    
  // Creating Calibration instance (to get some calibration constants and pedestal levels of VME modules/detectors)
  BL4SCalibration *cal = new BL4SCalibration(dat,cfg);
     
  vector<u_int> rawev;
  
  //Main loop
  for(int k=0;k<Nevents;k++)
  { 
    rawev = dat->GetNextRawEvent();
    
    //Creating BL4SEvent instance (that has information of signal on each detector)
    unique_ptr<BL4SEvent> ev(new BL4SEvent(rawev,cfg,cal));
    
    // Here one can do anything with pointer ev such as:
    int nevent = ev->GetEventNumbers();
    
    for(int i=0; i<Nlg;i++) 
    {
      lg[i].energy = ev->GetLeadGlassEnergy(i);                                                                                                                                  
    }
    
   } 

 
Deleted:
<
<
-- CenkYildiz - 19 Mar 2014
 \ No newline at end of file
Added:
>
>

Reading events online

  //Opening config file and setting congifuration
  BL4SConfig * cfg = new BL4SConfig("test.cfg");
    
  //Creating instance of debug object, which handles verbosity
  BL4SDebug *debug = new BL4SDebug(cfg->verbosity);
    
  //Getting important parameters
  int Ndwc    = cfg->n_dwc;
  int Nlg     = cfg->n_lead_glass;
  int Nscin   = cfg->n_scintillator;
    
  // Creating Calibration instance (to get some calibration constants and pedestal levels of VME modules/detectors)
  // Note that this time Datafile argument is not entered.
  BL4SCalibration *cal = new BL4SCalibration(cfg);
    
  vector<u_int> rawev;

  //Main loop 
  while(1)
  { 
    // There should be a function to dump raw data from the DAQ into a vector. Here I use a made up method
    rawev = DumpEvent();
    
    //Creating BL4SEvent instance (that has information of signal on each detector)
    unique_ptr<BL4SEvent> ev(new BL4SEvent(rawev,cfg,cal));
    
    // Here one can do anything with pointer ev such as:
    int nevent = ev->GetEventNumbers();
    
    for(int i=0; i<Nlg;i++) 
    {
      lg[i].energy = ev->GetLeadGlassEnergy(i);                                                                                                                                  
    }
    
   } 

-- CenkYildiz - 19 Mar 2014 -- CenkYildiz - 02 Jul 2014

Revision 32014-05-16 - CenkYildiz

Line: 1 to 1
 
META TOPICPARENT name="BeamLineForSchools"
Added:
>
>

SVN Repo

To checkout analysis code:

svn co svn+ssh://svn.cern.ch/reps/bl4sextras
 

CMT Tricks

Using an external shared object and header files in a program

Revision 22014-03-20 - CenkYildiz

Line: 1 to 1
 
META TOPICPARENT name="BeamLineForSchools"
Changed:
<
<
Compiling with cmt using external shared object
>
>

CMT Tricks

Using an external shared object and header files in a program

Lets say we want to compile myApp with libSomething, using some header files from "/path/to/inc". In our case libSomething is the library that contains the BL4S analysis classes. Following should be added to the requirements file

pattern -global default_include_path include_dirs ${<package>_root}/${<package>}  "/path/to/inc/"
 
path_append LD_LIBRARY_PATH "/path/to/lib/" 

application myapp  myApplication.cc
macro myapplinkopts "-L/path/to/lib/  -lSomething"
 

-- CenkYildiz - 19 Mar 2014 \ No newline at end of file

Revision 12014-03-19 - CenkYildiz

Line: 1 to 1
Added:
>
>
META TOPICPARENT name="BeamLineForSchools"
Compiling with cmt using external shared object

-- CenkYildiz - 19 Mar 2014

 
This site is powered by the TWiki collaboration platform Powered by PerlCopyright & 2008-2019 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback