Example program to histogram longitudinal shower profile using JPHYSICS::JGeanz.
More...
#include <string>
#include <iostream>
#include "TROOT.h"
#include "TFile.h"
#include "TH1D.h"
#include "TGraph.h"
#include "TRandom3.h"
#include "JPhysics/JGeanz.hh"
#include "JGizmo/JGizmoToolkit.hh"
#include "Jeep/JParser.hh"
#include "Jeep/JMessage.hh"
Go to the source code of this file.
|
int | main (int argc, char *argv[]) |
|
Example program to histogram longitudinal shower profile using JPHYSICS::JGeanz.
- Author
- mdejong
Definition in file JGeanz.cc.
int main |
( |
int |
argc, |
|
|
char * |
argv[] |
|
) |
| |
Definition at line 23 of file JGeanz.cc.
34 JParser<> zap(
"Example program to histogram longitudinal shower profile.");
43 catch(
const exception &error) {
44 FATAL(error.what() << endl);
52 TH1D h1(
"Probability", NULL, 1000, 0.0, 25.0);
53 TH1D h2(
"Integral", NULL, 1000, 0.0, 25.0);
54 TH1D h3(
"MC", NULL, 100, 0.0, 25.0);
56 for(
int i = 1;
i <= h1.GetNbinsX(); ++
i) {
58 const double x = h1.GetBinCenter(
i);
64 if (numberOfEvents != 0) {
66 for (
int i = 0;
i != numberOfEvents; ++
i) {
68 const double x = gRandom->Rndm();
81 g1.SetName(
"Maximum");
Utility class to parse command line options.
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
static const JGeanz geanz(1.85, 0.62, 0.54)
Function object for longitudinal EM-shower profile.
void convertToPDF(TH1 &h1, const std::string &option="NW", const double factor=1.0)
Convert 1D histogram to PDF.
double getIntegral(const double E, const double z) const
Integral of PDF (starting from 0).
double getMaximum(const double E) const
Get depth of shower maximum.
double getLength(const double E, const double P, const double eps=1.0e-3) const
Get shower length for a given integrated probability.
double getProbability(const double E, const double z) const
Probability Density Function.
Double_t g1(const Double_t x)
Function.