Skip to content
Snippets Groups Projects
EvtDataBaseList.hh 3.49 KiB
Newer Older
//************************************************************************//
//									  //
//  Copyright 2013 Bertram Kopf (bertram@ep1.rub.de)			  //
//  	      	   Julian Pychy (julian@ep1.rub.de)			  //
//          	   - Ruhr-Universität Bochum 				  //
//									  //
//  This file is part of Pawian.					  //
//									  //
//  Pawian is free software: you can redistribute it and/or modify	  //
//  it under the terms of the GNU General Public License as published by  //
//  the Free Software Foundation, either version 3 of the License, or 	  //
//  (at your option) any later version.	 	      	  	   	  //
//									  //
//  Pawian is distributed in the hope that it will be useful,		  //
//  but WITHOUT ANY WARRANTY; without even the implied warranty of	  //
//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the	  //
//  GNU General Public License for more details.	      		  //
//									  //
//  You should have received a copy of the GNU General Public License     //
//  along with Pawian.  If not, see <http://www.gnu.org/licenses/>.	  //
//									  //
//************************************************************************//

Bertram Kopf's avatar
Bertram Kopf committed
// EvtDataBaseList class definition file. -*- C++ -*-
// Copyright 2012 Bertram Kopf


#include "qft++/topincludes/relativistic-quantum-mechanics.hh"
#include <memory>
Bertram Kopf's avatar
Bertram Kopf committed
#include <boost/unordered_map.hpp>
#include <map>

#include "Utils/PawianCollectionUtils.hh"
#include "Utils/FunctionUtils.hh"
#include "PwaUtils/DataUtils.hh"
Bertram Kopf's avatar
Bertram Kopf committed
#include "Particle/Particle.hh"
typedef std::map<unsigned short, std::map<Id3StringType, complex<double> > > mapShortInt3Complex;
typedef std::map<unsigned short, std::map<Id1StringType, complex<double> > > mapShortInt1Complex;
typedef std::map<unsigned short, double> mapShortDouble;
typedef std::map<unsigned short, Vector4<double> > mapShort4Vec;
typedef std::map<unsigned short, map<Id2StringType, complex<double> > > mapShortInt2Complex;
typedef std::map<unsigned short, map<unsigned short, map<Id3StringType, complex<double> > > > mapShortShortInt3Complex;

struct EvtData {
  mapShortInt3Complex WignerDIdId3;
  mapShortInt1Complex WignerDIdId1;
  mapShortDouble DoubleId;
  mapShortDouble DoubleMassId;
  mapShort4Vec FourVecsId;
  mapShortInt2Complex Complex2Spin;
  mapShortShortInt3Complex ComplexLS3Spin;
  double evtWeight;
Bertram Kopf's avatar
Bertram Kopf committed
  int evtNo;
class Event;
class Particle;

class EvtDataBaseList {

public:
  virtual ~EvtDataBaseList();

Bertram Kopf's avatar
Bertram Kopf committed
  void read(EventList& evtListData, EventList& evtListMc);

Bertram Kopf's avatar
Bertram Kopf committed
  const std::vector<EvtData*> getDataVecs() const { return _evtDataList; }
  const std::vector<EvtData*> getMcVecs() const { return _mcDataList; }

  double NoOfWeightedDataEvts() const {return _noOfWeightedDataEvts;}
  double NoOfWeightedMcEvts() const {return _noOfWeightedMcEvts;}
  virtual void read4Vecs(EventList& evtList, std::vector<EvtData*>& theEvtList, double& evtWeightSum, int maxEvts, int startNo);
  virtual EvtData* convertEvent(Event* theEvent, int evtNo=1);
  static double noOfWeightedEvts(EventList& evtList, ChannelID channelID, int maxEvts, int startNo);
 
  std::vector<EvtData*> _evtDataList;
  std::vector<EvtData*> _mcDataList;
  virtual std::string getName(std::vector<Particle*>& theVec);
Bertram Kopf's avatar
Bertram Kopf committed

  double _noOfWeightedDataEvts;
  double _noOfWeightedMcEvts;
  //  int _mcToDataRatio;
Bertram Kopf's avatar
Bertram Kopf committed
  bool _alreadyRead;
  std::vector<Particle*>  _finalStateParticles;