Skip to content
Snippets Groups Projects
Commit 242faaa8 authored by matta's avatar matta
Browse files

* Creating new branch to hold developpement of a Tag Manager class

 - Class is implemented and file are added
 - Class need to be tested befor adding to the dev branch
parent 7e1e7362
No related branches found
No related tags found
No related merge requests found
......@@ -270,7 +270,7 @@ INCLUDE = -I$(CLHEP_BASE_DIR)/include
#------------------------------------------------------------------------------
SHARELIB = CalibManager Vdetec InputOutputRoot InitCond InterCoord \
Must2All GaspardData AnnularS1Data PlasticData DummyDetectorData SSSDData\
Reaction EnergyLoss ParisData ShieldData
Reaction EnergyLoss TagManager ParisData ShieldData
all: $(SHARELIB)
rm -f ./include/*Dict.h
......@@ -411,6 +411,13 @@ EnergyLoss:
ifeq ($(ARCH),macosx)
cd lib; ln -sf libEnergyLoss.so libEnergyLoss.dylib
endif
TagManager:
make libTagManager.so -C ./Tools
cp ./Tools/*.so ./lib ; cp ./Tools/*.h ./include
ifeq ($(ARCH),macosx)
cd lib; ln -sf libTagManager.so libTagManager.dylib
endif
#######################################
......
......@@ -268,7 +268,7 @@ GLIBS = $(ROOTGLIBS) $(SYSLIBS)
INCLUDE = -I$(CLHEP_BASE_DIR)/include
#------------------------------------------------------------------------------
SHARELIB = libReaction.so libEnergyLoss.so
SHARELIB = libReaction.so libEnergyLoss.so libTagManager.so
all: $(SHARELIB)
#------------------------------------------------------------------------------
......@@ -282,10 +282,15 @@ libReaction.so: NPReaction.o NPNucleus.o
libEnergyLoss.so: NPEnergyLoss.o
$(LD) $(SOFLAGS) $^ $(OutPutOpt) $@
## TAGManager ##
libTagManager.so: NPTagManager.o
$(LD) $(SOFLAGS) $^ $(OutPutOpt) $@
# dependances
NPReaction.o:NPReaction.cxx NPReaction.h
NPNucleus.o: NPNucleus.cxx NPNucleus.h
NPEnergyLoss.o:NPEnergyLoss.cxx NPEnergyLoss.h
NPTagManager.o:NPTagManager.cxx NPTagManager.h
#######################################
############# Clean and More ##########
......
/*****************************************************************************
* Copyright (C) 2009 this file is part of the NPTool Project *
* *
* For the licensing terms see $NPTOOL/Licence/NPTool_Licence *
* For the list of contributors see $NPTOOL/Licence/Contributors *
*****************************************************************************/
/*****************************************************************************
* *
* Original Author : Adrien MATTA contact address: matta@ipno.in2p3.fr *
* *
* Creation Date : November 2010 *
* Last update : *
*---------------------------------------------------------------------------*
* Decription: *
* This class will held a set of string, that can be used as a TAG manager *
* Users can write macro and add different TAG to that object based on users *
* condition. Then the TAG branch can be open and close alone to select event*
* without loading the whole tree. *
* *
*---------------------------------------------------------------------------*
* Comment: *
* *
* *
*****************************************************************************/
#include "NPTagManager.h"
using namespace NPL;
////////////////////////////////////////////
bool TagManager::Is(string condition)
{
// return True is the element is find, false other wise
return !( fTAG.find(condition)==fTAG.end() );
}
////////////////////////////////////////////
void TagManager::SetCondition(string condition)
{
fTAG.insert(condition);
}
////////////////////////////////////////////
void TagManager::PrintCondition()
{
set<string>::iterator it ;
cout << "------------------ Event Condition ------------------" << endl ;
for ( it=fTAG.begin() ; it!=fTAG.end() ; it++ )
{
cout << " " << *it << endl ;
}
cout << "-------------------------------------------------------" << endl ;
}
////////////////////////////////////////////
void TagManager::PrintConditionToFile(string filename)
{
ofstream file;
file.open(filename.c_str());
if(!file) {cout << "Warning: file " << filename << " not found " << endl ; return ;}
else
{
set<string>::iterator it ;
file << "------------------ Event Condition ------------------" << endl ;
for ( it=fTAG.begin() ; it!=fTAG.end() ; it++ )
{
file << " " << *it << endl ;
}
file << "-------------------------------------------------------" << endl ;
}
}
#ifndef __TAG__
#define __TAG__
/*****************************************************************************
* Copyright (C) 2009 this file is part of the NPTool Project *
* *
* For the licensing terms see $NPTOOL/Licence/NPTool_Licence *
* For the list of contributors see $NPTOOL/Licence/Contributors *
*****************************************************************************/
/*****************************************************************************
* *
* Original Author : Adrien MATTA contact address: matta@ipno.in2p3.fr *
* *
* Creation Date : November 2010 *
* Last update : *
*---------------------------------------------------------------------------*
* Decription: *
* This class will held a set of string, that can be used as a TAG manager *
* Users can write macro and add different TAG to that object based on users *
* condition. Then the TAG branch can be open and close alone to select event*
* without loading the whole tree. *
* *
*---------------------------------------------------------------------------*
* Comment: *
* *
* *
*****************************************************************************/
// C++ header
#include <iostream>
#include <fstream>
#include <string>
#include <set>
using namespace std;
// ROOT header
#include "TObject.h"
namespace NPL
{
class TagManager : public TObject{
public:
TagManager();
~TagManager();
private:
set<string> fTAG;
public:
// Return True if condition is in the set fTAG
bool Is(string condition);
// Add condition to the set fTAG
void SetCondition(string condition);
// Print all the condition that exist in fTAG
void PrintCondition();
inline void Print() {PrintCondition();};
// Print to File filename all the condition that exist in fTAG
void PrintConditionToFile(string filename);
// Clear all the fTAG
inline void Clear() {fTAG.clear();} ;
};
}
#endif
echo -L$NPLIB/lib -lVDetector -lDetectorManager -lCalibrationManager -lIORoot -lReaction -lEnergyLoss \
echo -L$NPLIB/lib -lVDetector -lDetectorManager -lCalibrationManager -lIORoot -lReaction -lEnergyLoss -lTagManager\
-lMust2Data -lMust2Physics \
-lSSSDData -lSSSDPhysics \
-lPlasticData -lPlasticPhysics \
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment