7 #include <marlin/AIDAProcessor.h>
8 #include "marlin/Exceptions.h"
9 #include <AIDA/IHistogramFactory.h>
10 #include <AIDA/ICloud1D.h>
13 #include "IMPL/LCEventImpl.h"
14 #include "IMPL/LCCollectionVec.h"
15 #include "IMPL/SimCalorimeterHitImpl.h"
16 #include "IMPL/CalorimeterHitImpl.h"
17 #include "IMPL/MCParticleImpl.h"
18 #include "IMPL/TrackerHitImpl.h"
19 #include "IMPL/TrackImpl.h"
20 #include "IMPL/ClusterImpl.h"
21 #include "IMPL/ReconstructedParticleImpl.h"
22 #include "IMPL/ParticleIDImpl.h"
23 #include "IMPL/LCFlagImpl.h"
25 #include "IMPL/LCRelationImpl.h"
28 #include <EVENT/LCCollection.h>
29 #include <EVENT/ReconstructedParticle.h>
31 using namespace lcio ;
32 using namespace marlin ;
34 using namespace JAMMA;
42 _description =
"Sphere calculates eigenvalues of sphericity tensor" ;
47 registerInputCollection( LCIO::RECONSTRUCTEDPARTICLE,
49 "Name of the ReconstructedParticle collection" ,
51 std::string(
"RecontructedParticle") ) ;
53 registerProcessorParameter(
"r_value",
54 " exponent in sphericity tensor use 2.0 for classical 1.0 for C,D",
57 registerProcessorParameter(
"eigenvalues_parameter_name",
58 "name of parameter to store the results ",
60 std::string(
"sphericity_tensor_eigenvalues"));
94 ReconstructedParticle* p;
98 catch(EVENT::DataNotAvailableException&){
99 streamlog_out(DEBUG) <<
"Cannot find PFO Collection in event/run " << evt->getEventNumber() <<
" / "<< evt->getRunNumber() <<std::endl;
100 streamlog_out(DEBUG) <<
"Skipping this event!" << std::endl;
101 throw marlin::SkipEventException(
this);
104 if (col->getNumberOfElements() == 0){
105 streamlog_out(DEBUG) <<
"PFO Collection is empty in event/run " << evt->getEventNumber() <<
" / "<< evt->getRunNumber() <<std::endl;
113 for (
int j=0;j<3;j++)
121 int nRecP = col->getNumberOfElements() ;
123 for(
int kk=0; kk< nRecP ; kk++){
124 p=
dynamic_cast<ReconstructedParticle*
>( col->getElementAt( kk ) );
127 pp = p->getMomentum() ;
129 Pduzi=sqrt(pow(pp[0],dvojka)+pow(pp[1],dvojka)+pow(pp[2],dvojka));
131 norm=norm+pow(Pduzi,(
double)
_r);
136 sp[j][i]=sp[j][i]+pp[i]*pp[j]*pow(Pduzi,(_r-dvojka));
147 sp[j][i]=sp[j][i]/norm;
158 sphericity=1.5*(lre[0]+lre[1]);
159 aplanarity=1.5*lre[0];
160 FloatVec udri_me_do_zore;
161 udri_me_do_zore.push_back(lre[0]);
162 udri_me_do_zore.push_back(lre[1]);
163 udri_me_do_zore.push_back(lre[2]);
165 col->parameters().setValue(
"sphericity",sphericity);
166 col->parameters().setValue(
"aplanarity",aplanarity);
172 ccc=3.0*(lre[0]*lre[1]+lre[0]*lre[2]+lre[2]*lre[1]);
173 ddd=27.0*lre[0]*lre[1]*lre[2];
174 col->parameters().setValue(
"C",ccc);
175 col->parameters().setValue(
"D",ddd);
std::string _dumpobjectname
Name of the parameter to store egenvalues of sphericity tensor.
virtual void end()
Called after data processing for clean up.
virtual void processRunHeader(LCRunHeader *run)
Called for every run.
virtual void check(LCEvent *evt)
virtual void processEvent(LCEvent *evt)
Called for every event - the working horse.
void getRealEigenvalues(float d_[3])
Return the real parts of the eigenvalues.
std::string _colName
Input collection name.
lcio::LCCollection * getCollection(lcio::LCEvent *evt, const std::string name)
helper function to get collection safely
virtual void init()
Called at the begin of the job before anything is read.
Processor that calculates sphericity,aplanarity, C and D event parametres for detail explanation look...