GSI Forum
GSI Helmholtzzentrum für Schwerionenforschung

Home » Hades » Pluto » [SOLVED] PVertexFile
[SOLVED] PVertexFile [message #13599] Wed, 13 June 2012 23:01 Go to previous message
Michael Kunkel is currently offline  Michael Kunkel
Messages: 53
Registered: June 2011
continuous participant
From: 129.57.114*
Greetings,

I had a question on the format of PVertexFile.
Is it one leaf of array vX:vY:vZ, or seperate leafs?

I ask because I am trying to smear vertices along a target that is 400mm in length and 20mm in radius.
I create a uniform distribution of 50M events of a cylinder equally the dimensions mentioned, called vertex.root with separate leaves vX, vY, vZ, tree name "vertex" as prescribed in
http://www-linux.gsi.de/~hadeshyp/pluto/v5.40/PVertexFile.html

When I attempt to use this

//#include "loadPluto.h";
//Program to generate multiple PLUTO root file
//Author Michael C. Kunkel
#include "TH1.h"
#include "TH2.h"
#include "TH3.h"
#include "TChain.h"
#include "TCanvas.h"
#include "TF1.h"
#include "/w/hallb/clasg12/mkunkel/PLUTO/pluto_v5.40/src/PParticle.h"
#include "/w/hallb/clasg12/mkunkel/PLUTO/pluto_v5.40/src/PReaction.h"
#include "/w/hallb/clasg12/mkunkel/PLUTO/pluto_v5.40/src/PBeamSmearing.h"
#include "/w/hallb/clasg12/mkunkel/PLUTO/pluto_v5.40/src/PVertexFile.h"


void Vertex_Simulation(){

    gROOT->Reset();

    char nam1[60] = "/volatile/clas/clasg12/mkunkel/GG_ETA_SIM/PLUTO_GEN/eta_";
    
    char nam2[25] = "_gammagamma_vertex";
   
    for(int ij = 1; ij<=1; ij++){
		char c[10];
		sprintf(c,"%d",ij);
		char creater[75];
		sprintf(creater,"%s%s%s",nam1,c,nam2);
		cout << creater<<endl;
	

    double ebeam_min = 1.1725;
    double ebeam_max = 5.44575;
    PBeamSmearing *beam_smear = new PBeamSmearing("beam_smear", "Beam smearing");
    
    TF1* beam_smear_fn = new TF1("beam_smear_fn", "1./x", ebeam_min, ebeam_max);    

    beam_smear->SetReaction("g + p");
    beam_smear->SetMomentumFunction(beam_smear_fn);
    makeDistributionManager()->Add(beam_smear);


    PReaction my_reaction("_P1 = 2.2","g","p","p eta [g g]",creater,1,0,1,0);
    
        //Construct the vertex container:
    PVertexFile *vertex = new PVertexFile();
    vertex->OpenFile("/w/hallb/clasg12/mkunkel/PLUTO/ETA_GAMMAGAMMA_SIM/VERTICES/vertex.root");
    //add to prologue action
    my_reaction.AddPrologueBulk(vertex);
    // my_reaction.Print();   //The "Print()" statement is optional
    my_reaction.Loop(50000);

    }
    
}


I receive a segmentation fault, if I remove the vertex the code runs correctly.

[Updated on: Wed, 22 May 2013 12:45] by Moderator

Report message to a moderator

 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: [SOLVED] pp->K0s+X with V5.34
Next Topic: Multiple branches in the Pluto-file
Goto Forum:
  


Current Time: Thu Mar 28 21:33:54 CET 2024

Total time taken to generate the page: 0.01044 seconds