<!--##########################################
    #                                        #
    #     Create Flavour Tag variables       #
    #                                        #
    ##########################################-->


<marlin>
 <execute>
  <processor name="FTRPCutProcessor"/>
  <processor name="MyFlavourTagInputsProcessor"/>
  <processor name="MyLCIOOutputProcessor"/>
 </execute>

 <global>
  <parameter name="LCIOInputFiles"> zvresout.slcio </parameter>
  <!-- limit the number of processed records (run+evt): -->  
  <!--parameter name="MaxRecordNumber" value="5001" /-->  
  <parameter name="SupressCheck" value="false" />  
  <!--- parameter name="GearXMLFile"> GearOutput.xml </parameter> -->  
 </global>

<processor name="FTRPCutProcessor" type="RPCutProcessor">
 <!--RPCutProcessor - cuts tracks based on several criteria-->
  <!--Name of the ReconstructedParticle collection which will be cut-->
  <parameter name="InputRCPCollection" type="string" lcioInType="ReconstructedParticle">Jets </parameter>
  <!--Name of the output ReconstructedParticle collection when WriteNewCollection is true-->
  <parameter name="OutputRCPCollection" type="string" lcioOutType="ReconstructedParticle">FTSelectedJets </parameter>
  <!--If true cuts tracks from the particle lists of particles in InputRCPCollection, if false just cuts particles from InputRCPCollection-->
  <parameter name="SubParticleLists" type="bool">true </parameter>
  <!--Name of the Track collection - this is just used to get the sub dectector indices-->
  <parameter name="WriteNewCollection" type="bool">true </parameter>
  
  <!--Enable a cut on the value of each tracks chi squared over degrees of freedom-->
  <!--parameter name="a1_Chi2OverDOFEnable" type="bool">false </parameter-->
  <!--If true values lower than the cut value will be cut, if false values higher will be cut-->
  <!--parameter name="a2_Chi2OverDOFCutLowerThan" type="bool">false </parameter-->
  <!--Cut Value-->
  <!--parameter name="a3_Chi2OverDOFCutValue" type="float">10 </parameter-->
  
  <!--Enable a cut on the value of each tracks d0 (no correction for ref point position)-->
  <parameter name="b1_D0Enable" type="bool">true </parameter>
  <!--If true values lower than the cut value will be cut, if false values higher will be cut-->
  <parameter name="b2_D0CutLowerThan" type="bool">false </parameter>
  <!--Cut Value-->
  <parameter name="b3_D0CutValue" type="float">20 </parameter>
  
  <!--Enable a cut on the value of each tracks d0 Error (sqrt(covariance(d0,d0))-->
  <!--parameter name="c1_D0ErrEnable" type="bool">false </parameter-->
  <!--If true values lower than the cut value will be cut, if false values higher will be cut-->
  <!--parameter name="c2_D0ErrCutLowerThan" type="bool">false </parameter-->
  <!--Cut Value-->
  <!--parameter name="c3_D0ErrCutValue" type="float">0.025 </parameter-->
  
  <!--Enable a cut on the value of each tracks Z0 (no correction for ref point position)-->
  <parameter name="d1_Z0Enable" type="bool">true </parameter>
  <!--If true values lower than the cut value will be cut, if false values higher will be cut-->
  <parameter name="d2_Z0CutLowerThan" type="bool">false </parameter>
  <!--Cut Value-->
  <parameter name="d3_Z0CutValue" type="float">20 </parameter>
  
  <!--Enable a cut on the value of each tracks z0 Error (sqrt(covariance(z0,z0))-->
  <!--parameter name="e1_Z0ErrEnable" type="bool">false </parameter-->
  <!--If true values lower than the cut value will be cut, if false values higher will be cut-->
  <!--parameter name="e2_Z0ErrCutLowerThan" type="bool">true </parameter-->
  <!--Cut Value-->
  <!--parameter name="e3_Z0ErrCutValue" type="float">0.025 </parameter-->
  
  <!--Enable a cut on the value of each tracks PT (radial magnitude of ReconstructedParticle->momentum())-->
  <parameter name="f1_PTEnable" type="bool">true </parameter>
  <!--If true values lower than the cut value will be cut, if false values higher will be cut-->
  <parameter name="f2_PTCutLowerThan" type="bool">true </parameter>
  <!--Cut Value-->
  <parameter name="f3_PTCutValue" type="float">0.1 </parameter>
  
  <!--Enable a cut on the number seen hits in sub detectors - for more details see documentation-->
  <parameter name="g1_DetectorHitsEnable" type="bool">true </parameter>
  <!--Sub detector names in same order as result of Track->getSubdetectorHitNumbers()-->
  <parameter name="g2_SubDetectorNames" type="StringVec">VTX FTD SIT TPC </parameter>
  <!--Sub detector names of detectors defining the boundary between region 1 and region 2-->
  <parameter name="g3_DetectorHitsBoundaryDetectorNames" type="StringVec">TPC FTD  </parameter>
  <!--Corresponding to the order of DetectorHitsBoundaryDetectorNames the max number of hits for each detector for region 1, if any of the sub detectors has a higher number of hits then region 2 is used-->
  <parameter name="g4_DetectorHitsBoundaryCuts" type="IntVec">20 3  </parameter>
  <!--Sub detector names of detectors used for cutting in region 1-->
  <parameter name="g5_DetectorHitsRegion1DetectorNames" type="StringVec">VTX  </parameter>
  <!--Corresponding to the order of DetectorHitsRegion1DetectorNames the minimum number of hits for region 1 for a track to pass-->
  <parameter name="g6_DetectorHitsRegion1Cuts" type="IntVec">3  </parameter>
  <!--Sub detector names of detectors used for cutting in region 2-->
  <parameter name="g7_DetectorHitsRegion2DetectorNames" type="StringVec">VTX  </parameter>
  <!--Corresponding to the order of DetectorHitsRegion2DetectorNames the minimum number of hits for region 2 for a track to pass-->
  <parameter name="g8_DetectorHitsRegion2Cuts" type="IntVec">0  </parameter>
  
  <!--Enable a cut on the PDG code of the Monte Carlo particle associated with the track. Set the codes to cut on in CutPIDS and the LCRelation collection name to the MC data in MonteCarloLCRelationCollection-->
  <parameter name="h1_MCPIDEnable" type="bool">true </parameter>
  <!--A list of all the PDG codes of the parent Monte Carlo particle to cut-->
  <parameter name="h2_CutPIDS" type="IntVec">310 -310 3122 -3122  </parameter>
  <!--Name of the LCRelation collection which links InputRCPCollection to the Monte Carlo data. Required only if MCPIDEnable is true-->
  <parameter name="h3_MonteCarloLCRelationCollection" type="string" lcioInType="LCRelation">FittedTrueTracksMCP</parameter>
  <!--Enable a cut on tracks with NaN parameters or covariances-->
  <parameter name="i1_BadParametersEnable" type="bool">true </parameter>
</processor>



<processor name="MyFlavourTagInputsProcessor" type="FlavourTagInputsProcessor">
  <!--FlavourTagInputsProcessor - takes a set of vertices as a decay chain with its associated jet and calculates flavour tag inputs stroring them in the Jet RP's pid-->
  <!--Momentum cuts will be applied on number of LayersHit and LayersHit minus one-->
  <!--parameter name="LayersHit" type="double">5 </parameter-->   
  <!--Cut on the minimum momentum if track hits LayersHit-->
  <!--parameter name="AllLayersMomentumCut" type="double">1 </parameter-->
  <!--Cut on the minimum momentum if track hits LayersHit minus one-->
  <!--parameter name="AllbutOneLayersMomentumCut" type="double">2 </parameter-->
  <!--Parameter determining whether all tracks from secondary are included in the B-Charge-->
  <!--parameter name="BChargeAllSecondaryTracks" type="bool">true </parameter-->
  <!--Upper cut on track distance of closest approach to the seed axis for the B-Charge -->
  <!--parameter name="BChargeCloseapproachCut" type="double">1 </parameter-->
  <!--Cut determining the maximum L/D for the B-Charge-->
  <!--parameter name="BChargeLoDCutmax" type="double">2.5 </parameter-->
  <!--Cut determining the minimum L/D for the B-Charge-->
  <!--parameter name="BChargeLoDCutmin" type="double">0.18 </parameter-->
  <!--Parameter determining whether all tracks from secondary are included in the C-Charge-->
  <!--parameter name="CChargeAllSecondaryTracks" type="bool">false </parameter-->
  <!--Upper cut on track distance of closest approach to the seed axis for the C-Charge -->
  <!--parameter name="CChargeCloseapproachCut" type="double">1 </parameter-->
  <!--Cut determining the maximum L/D for the C-Charge-->
  <!--parameter name="CChargeLoDCutmax" type="double">2.5 </parameter-->
  <!--Cut determining the minimum L/D for the C-Charge-->
  <!--parameter name="CChargeLoDCutmin" type="double">0.5 </parameter-->
  <!--Name of the ReconstructedParticle collection that represents decay chains-->
  <parameter name="DecayChainRPCollection" type="string" lcioInType="ReconstructedParticle">ZVRESDecayChains </parameter>
  <!--Name of the LCFloatVec Collection that will be created to contain the flavour tag inputs-->
  <parameter name="FlavourTagInputsCollection" type="string" lcioOutType="LCFloatVec">FlavourTagInputs </parameter>
  <!--Name of the Vertex collection that contains the primary vertex (Optional)-->
  <parameter name="IPVertexCollection" type="string" lcioInType="Vertex">IPVertex </parameter>
  <!--Upper Cut on the maximum value of d0 significance-->
  <!--parameter name="JProbMaxD0Significance" type="double">200 </parameter-->
  <!--Upper Cut on the maximum value of d0 and of z0-->
  <!--parameter name="JProbMaxD0andZ0" type="double">5 </parameter-->
  <!--Name of the ReconstructedParticle collection that represents jets-->
  <parameter name="JetRPCollection" type="string" lcioInType="ReconstructedParticle">FTSelectedJets </parameter>
  <!--Momentum cuts will be applied on number of LayersHit and LayersHit minus one-->
  <!--parameter name="LayersHit" type="double">5 </parameter-->
  <!--Cut on the Chi squared of the two tracks beinig in the same vertex.-->
  <!--parameter name="PIDChi2Cut" type="double">6.63 </parameter-->
  <!--Cut on the upper limit of the photon candidate mass-->
  <!--parameter name="PIDMaxGammaMass" type="double">0.02 </parameter-->
  <!--Cut on the upper limit of the Ks candidate mass-->
  <!--parameter name="PIDMaxKsMass" type="double">0.525 </parameter-->
  <!--Cut on the lower limit of the Ks candidate mass-->
  <!--parameter name="PIDMinKsMass" type="double">0.475 </parameter-->
  <!--Cut on the maximum RPhi of the Ks/gamma decay vertex candidate-->
  <!--parameter name="PIDRPhiCut" type="double">20 </parameter-->
  <!--Cut on the minimum RPhi significance of the tracks-->
  <!--parameter name="PIDSignificanceCut" type="double">3 </parameter-->
  <!--Cut on the minimum number of tracks in the seed vertex.-->
  <!--parameter name="SecondVertexNtrackscut" type="double">1 </parameter-->
  <!--Cut on the Chi Squared of the seed vertex-->
  <!--parameter name="SecondVertexProbChisquarecut" type="double">20 </parameter-->
  <!--Parameter determining whether all tracks from secondary are included in the track attachment-->
  <!--parameter name="TrackAttachAllSecondaryTracks" type="bool">false </parameter-->
  <!--Upper cut on track distance of closest approach to the seed axis for the track attachment-->
  <!--parameter name="TrackAttachCloseapproachCut" type="double">1 </parameter-->
  <!--Cut determining the maximum L/D for the track attachment-->
  <!--parameter name="TrackAttachLoDCutmax" type="double">2.5 </parameter-->
  <!--Cut determining the minimum L/D for the track attachment-->
  <!--parameter name="TrackAttachLoDCutmin" type="double">0.18 </parameter-->
  <!--Maximum Sigma (based on error matrix) that the vertex axis can move when kinematic correction is applied-->
  <!--parameter name="VertexMassMaxKinematicCorrectionSigma" type="double">2 </parameter-->
  <!--Upper cut on angle between momentum of vertex and the vertex axis-->
  <!--parameter name="VertexMassMaxMomentumAngle" type="double">3 </parameter-->
  <!--Maximum factor, by which vertex mass can be corrected-->
  <!--parameter name="VertexMassMaxMomentumCorrection" type="double">2 </parameter-->
</processor>


<processor name="MyLCIOOutputProcessor" type="LCIOOutputProcessor">
<!--Writes the current event to the specified LCIO outputfile. Needs to be the last ActiveProcessor.-->
  <!--drops the named collections from the event-->
  <!--parameter name="DropCollectionNames" type="StringVec">TPCHits HCalHits  </parameter-->
  <!--drops all collections of the given type from the event-->
  <!--parameter name="DropCollectionTypes" type="StringVec">SimTrackerHit SimCalorimeterHit  </parameter-->
  <!-- name of output file -->
  <parameter name="LCIOOutputFile" type="string">ftiout.slcio </parameter>
  <!--write mode for output file:  WRITE_APPEND or WRITE_NEW-->
  <parameter name="LCIOWriteMode" type="string">WRITE_NEW </parameter>
  <!--will split output file if size in kB exceeds given value - doesn't work with APPEND and NEW-->
  <!--parameter name="SplitFileSizekB" type="int">1992294 </parameter-->
</processor>

</marlin>
